Skip to content

Commit

Permalink
chore(mobile): remove profile dot grid (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 authored Sep 2, 2024
1 parent 0d0fa02 commit 6d3d604
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
6 changes: 5 additions & 1 deletion apps/mobile/app/(app)/budget/[budgetId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export default function BudgetDetailScreen() {

const { budgetId } = useLocalSearchParams<{ budgetId: string }>()
const { budget } = useBudget(budgetId!)
const periodConfigs = sortBy(budget?.periodConfigs, (pc) => pc.startDate)
const periodConfigs = sortBy(
budget?.periodConfigs,
(pc) => pc.startDate,
'desc',
)
const [currentPeriodIndex, setCurrentPeriodIndex] = useState<number>(
periodConfigs.length - 1,
)
Expand Down
51 changes: 29 additions & 22 deletions apps/mobile/components/setting/profile-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,34 +117,41 @@ const Dot = ({ dot, fromIndex }: DotProps) => {
)
}

export function ProfileCard() {
const { user } = useUser()
export const DotsGrid = () => {
const fromIndex = useSharedValue(
dots[Math.round(ROWS / 2)][Math.round(COLS / 2)],
)

return (
<View className="flex flex-1">
{dots.map((row, rowIndex) => {
return (
<View className="flex-row" key={rowIndex.toString()}>
{row.map((dot) => {
return (
<Pressable
key={dot.key.toString()}
onPress={() => {
fromIndex.value = dot
}}
>
<Dot dot={dot} fromIndex={fromIndex} />
</Pressable>
)
})}
</View>
)
})}
</View>
)
}

export function ProfileCard() {
const { user } = useUser()

return (
<View className="mx-6 h-52 justify-end overflow-hidden rounded-lg bg-muted">
<View className="flex flex-1">
{dots.map((row, rowIndex) => {
return (
<View className="flex-row" key={rowIndex.toString()}>
{row.map((dot) => {
return (
<Pressable
key={dot.key.toString()}
onPress={() => {
fromIndex.value = dot
}}
>
<Dot dot={dot} fromIndex={fromIndex} />
</Pressable>
)
})}
</View>
)
})}
</View>
<View className="flex flex-1"></View>
<BlurView
intensity={15}
className="flex flex-row items-center justify-between gap-2 px-4 py-3"
Expand Down

0 comments on commit 6d3d604

Please sign in to comment.