diff options
Diffstat (limited to 'src/screens/chat/ChatSearchBar.tsx')
| -rw-r--r-- | src/screens/chat/ChatSearchBar.tsx | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/src/screens/chat/ChatSearchBar.tsx b/src/screens/chat/ChatSearchBar.tsx index 91018d4c..1c91f493 100644 --- a/src/screens/chat/ChatSearchBar.tsx +++ b/src/screens/chat/ChatSearchBar.tsx @@ -17,6 +17,7 @@ interface SearchBarProps extends TextInputProps {    onCancel: () => void;    searching: boolean;    placeholder: string; +  label?: string;  }  const ChatSearchBar: React.FC<SearchBarProps> = ({    onFocus, @@ -26,6 +27,7 @@ const ChatSearchBar: React.FC<SearchBarProps> = ({    onCancel,    onLayout,    placeholder, +  label,  }) => {    const handleSubmit = (      e: NativeSyntheticEvent<TextInputSubmitEditingEventData>, @@ -34,14 +36,18 @@ const ChatSearchBar: React.FC<SearchBarProps> = ({      Keyboard.dismiss();    }; +  const extraLabelStyle = {paddingLeft: label ? 0 : 10}; +    return (      <View style={styles.container} onLayout={onLayout}>        <Animated.View style={styles.inputContainer}> -        <Animated.View style={styles.searchTextContainer}> -          <Text style={styles.searchTextStyes}>To:</Text> -        </Animated.View> +        {label && ( +          <Animated.View style={styles.searchTextContainer}> +            <Text style={styles.searchTextStyes}>{label}</Text> +          </Animated.View> +        )}          <TextInput -          style={styles.input} +          style={[extraLabelStyle, styles.input]}            placeholderTextColor={'#828282'}            onSubmitEditing={handleSubmit}            clearButtonMode="always" | 
