-
-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MOB-53] All tags screen - visual improvements - and more (#2074)
all tags screen, visual improvements, and bug fix
- Loading branch information
Showing
10 changed files
with
86 additions
and
23 deletions.
There are no files selected for viewing
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
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
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,49 @@ | ||
import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs'; | ||
import { useNavigation } from '@react-navigation/native'; | ||
import { View } from 'react-native'; | ||
import { FlatList } from 'react-native-gesture-handler'; | ||
import { useCache, useLibraryQuery, useNodes } from '@sd/client'; | ||
import { BrowseTagItem } from '~/components/browse/BrowseTags'; | ||
import Fade from '~/components/layout/Fade'; | ||
import { tw, twStyle } from '~/lib/tailwind'; | ||
import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; | ||
|
||
export default function Tags() { | ||
const height = useBottomTabBarHeight(); | ||
const tags = useLibraryQuery(['tags.list']); | ||
const navigation = useNavigation<BrowseStackScreenProps<'Browse'>['navigation']>(); | ||
|
||
useNodes(tags.data?.nodes); | ||
const tagData = useCache(tags.data?.items); | ||
return ( | ||
<View style={twStyle('relative flex-1 bg-mobile-screen px-7', { marginBottom: height })}> | ||
<Fade | ||
fadeSides="top-bottom" | ||
orientation="vertical" | ||
color="mobile-screen" | ||
width={30} | ||
height="100%" | ||
> | ||
<FlatList | ||
data={tagData} | ||
renderItem={({ item }) => ( | ||
<BrowseTagItem | ||
tagStyle="w-[105px]" | ||
tag={item} | ||
onPress={() => | ||
navigation.navigate('Tag', { id: item.id, color: item.color! }) | ||
} | ||
/> | ||
)} | ||
numColumns={3} | ||
columnWrapperStyle={tw`gap-2.5`} | ||
horizontal={false} | ||
keyExtractor={(item) => item.id.toString()} | ||
showsHorizontalScrollIndicator={false} | ||
ItemSeparatorComponent={() => <View style={tw`h-2.5`} />} | ||
contentContainerStyle={tw`py-5`} | ||
/> | ||
</Fade> | ||
</View> | ||
); | ||
} |
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