Skip to content

Commit

Permalink
routing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthonyp0329 committed Mar 7, 2024
1 parent 2d13856 commit 887d4a1
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions dfm-sideline-sidekick-app/pages/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,27 @@ const SearchPage: React.FC = () => {
inputRef={inputRef}
/>
<View>
{isFocused ? (
query.length > 0 ? (
<FlatList
{query.length === 0 ? (
isFocused ? (
<Text>Recent Searches...</Text>
) : (
<Text>Home Screen Cards...</Text>
)
) : (
<FlatList
data={filteredDocuments}
keyExtractor={(item) => item._id}
ItemSeparatorComponent={() => <View style={styles.divider} />}
renderItem={({ item }) => (
<TouchableOpacity
style={styles.listItemContainer}
onPress={() => {
navigation.navigate("MedicalConditions", { emergency: item });
if (item.content !== undefined) {
// navigation.navigate("General")
console.log(item.content)
} else {
navigation.navigate("MedicalConditions", { emergency: item });
}
}}
>
<View style={styles.listItemTextContainer}>
Expand All @@ -122,11 +132,6 @@ const SearchPage: React.FC = () => {
</TouchableOpacity>
)}
/>
) : (
<Text>Recent Searches...</Text>
)
) : (
<Text>Home Screen Cards...</Text>
)}
</View>
</View>
Expand Down

0 comments on commit 887d4a1

Please sign in to comment.