Skip to content

Commit

Permalink
feat: bigger view selector
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jan 24, 2025
1 parent ccd1978 commit 973c0d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions apps/mobile/src/modules/feed-drawer/atoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,5 @@ export const selectFeed = (state: SelectedFeed) => {

export const useViewDefinition = (view?: FeedViewType) => {
const viewDef = useMemo(() => views.find((v) => v.view === view), [view])
if (!viewDef) {
throw new Error(`View ${view} not found`)
}
return viewDef
}
12 changes: 6 additions & 6 deletions apps/mobile/src/modules/feed-drawer/view-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function ViewSelector() {
const lists = useAllListSubscription()

return (
<View className="flex items-center justify-between px-3 pt-1">
<View className="flex items-center justify-between px-3 py-2">
<ScrollView horizontal contentContainerClassName="flex-row gap-3 items-center">
{views.map((view) => (
<ViewItem key={view.name} view={view} />
Expand All @@ -36,13 +36,13 @@ function ViewItem({ view }: { view: ViewDefinition }) {

return (
<TouchableOpacity
className="relative flex size-8 items-center justify-center overflow-hidden rounded-full"
className="relative flex size-12 items-center justify-center overflow-hidden rounded-full"
onPress={() => selectFeed({ type: "view", viewId: view.view })}
style={{
backgroundColor: isActive ? view.activeColor : bgColor,
}}
>
<view.icon color={"#fff"} height={15} width={15} />
<view.icon color={"#fff"} height={21} width={21} />
</TouchableOpacity>
)
}
Expand All @@ -56,15 +56,15 @@ function ListItem({ listId }: { listId: string }) {

return (
<TouchableOpacity
className="relative flex size-8 items-center justify-center overflow-hidden rounded-full"
className="relative flex size-12 items-center justify-center overflow-hidden rounded-full"
onPress={() => selectFeed({ type: "list", listId })}
>
{list.image ? (
isActive ? (
<Image source={list.image} contentFit="cover" style={{ width: 32, height: 32 }} />
<Image source={list.image} contentFit="cover" className="size-12" />
) : (
<Grayscale>
<Image source={list.image} contentFit="cover" style={{ width: 32, height: 32 }} />
<Image source={list.image} contentFit="cover" className="size-12" />
</Grayscale>
)
) : (
Expand Down

0 comments on commit 973c0d2

Please sign in to comment.