-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RecentSearches display on frontend when searchbar is empty, Clear All…
… button works and clears recentSearches, Stack logic implemented to show most recentSearch on top and more
- Loading branch information
Marcos Hernandez
committed
Nov 21, 2023
1 parent
e184889
commit 9c7281e
Showing
5 changed files
with
122 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { GestureResponderEvent, Pressable, View, Text } from 'react-native'; | ||
import Icon from 'react-native-vector-icons/AntDesign'; | ||
|
||
import styles from './styles'; | ||
import globalStyles from '../../styles/globalStyles'; | ||
|
||
type RecentSearchCardProps = { | ||
value: string; | ||
numResults: number; | ||
pressFunction: (event: GestureResponderEvent) => void; | ||
}; | ||
|
||
function RecentSearchCard({ | ||
value, | ||
numResults, | ||
pressFunction, | ||
}: RecentSearchCardProps) { | ||
return ( | ||
<Pressable onPress={pressFunction}> | ||
<View style={styles.card}> | ||
<View style={styles.textContainer}> | ||
<Icon name="search1" size={18} color="#A7A5A5" /> | ||
<Text>{value}</Text> | ||
<Text>{numResults} Results</Text> | ||
<Icon name="caretright" size={18} color="black" /> | ||
</View> | ||
</View> | ||
</Pressable> | ||
); | ||
} | ||
|
||
export default RecentSearchCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
import colors from '../../styles/colors'; | ||
|
||
const styles = StyleSheet.create({ | ||
card: { | ||
flexDirection: 'row', | ||
justifyContent: 'flex-start', | ||
alignItems: 'center', | ||
backgroundColor: colors.lightGrey, | ||
borderRadius: 4, | ||
marginBottom: 16, | ||
maxHeight: 100, | ||
paddingLeft: 12, | ||
paddingRight: 12, | ||
}, | ||
textContainer: { | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
}, | ||
}); | ||
|
||
export default styles; |