From 9b5f4c27134e33fdc66a8158da2b3f8df1ffde99 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 21 Jan 2025 22:24:32 +0800 Subject: [PATCH] feat: collection panel styles --- .../modules/feed-drawer/collection-panel.tsx | 42 +++++++++---------- .../mobile/src/modules/feed-drawer/drawer.tsx | 2 +- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/apps/mobile/src/modules/feed-drawer/collection-panel.tsx b/apps/mobile/src/modules/feed-drawer/collection-panel.tsx index a067e7b2a..6437c64c7 100644 --- a/apps/mobile/src/modules/feed-drawer/collection-panel.tsx +++ b/apps/mobile/src/modules/feed-drawer/collection-panel.tsx @@ -1,15 +1,9 @@ import { cn } from "@follow/utils" -import { - Image, - ScrollView, - StyleSheet, - TouchableOpacity, - useWindowDimensions, - View, -} from "react-native" +import { Image, ScrollView, StyleSheet, TouchableOpacity, View } from "react-native" import { useSafeAreaInsets } from "react-native-safe-area-context" import { FallbackIcon } from "@/src/components/ui/icon/fallback-icon" +import { Logo } from "@/src/components/ui/logo" import type { ViewDefinition } from "@/src/constants/views" import { views } from "@/src/constants/views" import { useList } from "@/src/store/list/hooks" @@ -18,23 +12,26 @@ import { useAllListSubscription } from "@/src/store/subscription/hooks" import { selectCollection, useSelectedCollection } from "./atoms" export const CollectionPanel = () => { - const winDim = useWindowDimensions() const lists = useAllListSubscription() const insets = useSafeAreaInsets() return ( + + + + {views.map((viewDef) => ( ))} - + {lists.map((listId) => ( ))} @@ -56,7 +53,7 @@ const ViewButton = ({ viewDef }: { viewDef: ViewDefinition }) => { return ( @@ -65,8 +62,9 @@ const ViewButton = ({ viewDef }: { viewDef: ViewDefinition }) => { viewId: viewDef.view, }) } + style={{ backgroundColor: viewDef.activeColor }} > - + ) } @@ -80,7 +78,7 @@ const ListButton = ({ listId }: { listId: string }) => { return ( @@ -90,13 +88,11 @@ const ListButton = ({ listId }: { listId: string }) => { }) } > - - {list.image ? ( - - ) : ( - - )} - + {list.image ? ( + + ) : ( + + )} ) } diff --git a/apps/mobile/src/modules/feed-drawer/drawer.tsx b/apps/mobile/src/modules/feed-drawer/drawer.tsx index 7ecb4ef22..da1ef9fad 100644 --- a/apps/mobile/src/modules/feed-drawer/drawer.tsx +++ b/apps/mobile/src/modules/feed-drawer/drawer.tsx @@ -46,7 +46,7 @@ export const FeedDrawer = ({ children }: PropsWithChildren) => { return (