Skip to content

Commit

Permalink
Ready for styling
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Apr 24, 2024
1 parent 1381ba6 commit 6622997
Showing 1 changed file with 44 additions and 39 deletions.
83 changes: 44 additions & 39 deletions src/app/(tabs)/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function SearchScreen() {
getRecentStory().then((viewed: StoryPreview[]) =>
setRecentlyViewed(viewed),
);
})().then(() => {});
})().then(() => { });
}, []);

useEffect(() => {
Expand Down Expand Up @@ -458,6 +458,48 @@ function SearchScreen() {
}}
/>

{
searchResults && searchResults.length > 0 && (
<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
contentContainerStyle={[
styles.dropdownContainer,
styles.firstDropdown,
]}
>
{search
? renderFilterDropdown(
'Genre',
selectedMultipleGenresForFiltering,
genreFilterOptions,
setSelectedMultipleGenresForFiltering,
)
: renderGenreDropdown('Genre', selectedGenre, genreFilterOptions)}
{renderFilterDropdown(
'Topic',
selectedTopicsForFiltering,
topicFilterOptions,
setSelectedTopicsForFiltering,
)}
{renderFilterDropdown(
'Tone',
selectedTonesForFiltering,
toneFilterOptions,
setSelectedTonesForFiltering,
)}
</ScrollView>
)}

{search && (
<View>
<TouchableOpacity onPress={() => clearFilters()}>
<Text>Clear Filters</Text>
</TouchableOpacity>
</View>
)}


{/* {search && ( */}
{/* <View style={styles.default}> */}
{/* <Button */}
Expand Down Expand Up @@ -572,43 +614,6 @@ function SearchScreen() {
</View>
))}

<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
contentContainerStyle={[
styles.dropdownContainer,
styles.firstDropdown,
]}
>
{search
? renderFilterDropdown(
'Genre',
selectedMultipleGenresForFiltering,
genreFilterOptions,
setSelectedMultipleGenresForFiltering,
)
: renderGenreDropdown('Genre', selectedGenre, genreFilterOptions)}
{renderFilterDropdown(
'Topic',
selectedTopicsForFiltering,
topicFilterOptions,
setSelectedTopicsForFiltering,
)}
{renderFilterDropdown(
'Tone',
selectedTonesForFiltering,
toneFilterOptions,
setSelectedTonesForFiltering,
)}
</ScrollView>

{search && (
<View>
<TouchableOpacity onPress={() => clearFilters()}>
<Text>Clear Filters</Text>
</TouchableOpacity>
</View>
)}

{showGenreCarousals ? (
<ScrollView
Expand Down Expand Up @@ -696,7 +701,7 @@ function SearchScreen() {
{/* title="Genre" */}
{/* /> */}
</View>
</SafeAreaView>
</SafeAreaView >
);
}

Expand Down

0 comments on commit 6622997

Please sign in to comment.