From 56ecc399df819c7b3229698b575e24b8c7d378be Mon Sep 17 00:00:00 2001 From: GW_MC <72297530+GWMCwing@users.noreply.github.com> Date: Thu, 28 May 2026 05:48:14 +0000 Subject: [PATCH] feat: enhance layout with AccountDisplay component and improved BottomNavigation --- src/layout.tsx | 66 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/src/layout.tsx b/src/layout.tsx index 3a4cb3e..b0b97ac 100644 --- a/src/layout.tsx +++ b/src/layout.tsx @@ -1,37 +1,61 @@ -import { Home, Bell, FileText, User, Menu } from 'lucide-react'; -import { useState } from 'react'; +import { Home, Bell, FileText, User, Menu, CirclePlus } from 'lucide-react'; +import { useMemo, useState } from 'react'; import { Button } from './components/ui/button'; +import { useAppStore } from './store'; +import { useShallow } from 'zustand/react/shallow'; + +function AccountDisplay({ info }: { info: { name: string; balance: string } | null | undefined }) { + const name = useMemo(() => info?.name ?? 'No account selected', [info]); + const balance = useMemo(() => info?.balance ?? '--', [info]); + return ( + <> +
{name}
+${balance}
+ > + ); +} function TopNavigation() { - const [isMenuOpen, setIsMenuOpen] = useState(false); + const { accounts, selectedAccountId } = useAppStore(useShallow((state) => ({ accounts: state.accounts, selectedAccountId: state.selectedAccountId }))); + + const selectedAccount = accounts.find((account) => account.id === selectedAccountId); + return (Cisko bank
-$35,500
+