aboutsummaryrefslogtreecommitdiff
path: root/src/screens/chat/ChatSearchBar.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-21 21:47:43 -0400
committerGitHub <noreply@github.com>2021-05-21 21:47:43 -0400
commit5afdf9208fd3d7498a2595797e6c9fb5f567fc61 (patch)
treeb76d16e06c0fb5f89a3da9ffa44eddec71f9d52c /src/screens/chat/ChatSearchBar.tsx
parent83802c3a18b1a1406cb4f1336b91e477161e7340 (diff)
parentdcbe315638f6c5edc98415d6cec2a016bfc601bf (diff)
Merge pull request #436 from shravyaramesh/tma853-tag-selection-screen
[TMA-853] Tag selection screen
Diffstat (limited to 'src/screens/chat/ChatSearchBar.tsx')
-rw-r--r--src/screens/chat/ChatSearchBar.tsx14
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"