diff --git a/pages/Home.tsx b/pages/Home.tsx index e0c2262..ca4366c 100644 --- a/pages/Home.tsx +++ b/pages/Home.tsx @@ -1,6 +1,6 @@ import dayjs from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; -import { Link, useFocusEffect } from "expo-router"; +import { Link, router, useFocusEffect } from "expo-router"; import { useBalance } from "hooks/useBalance"; import React, { useState } from "react"; import { @@ -23,6 +23,8 @@ import LargeArrowUp from "~/components/icons/LargeArrowUp"; import Screen from "~/components/Screen"; import { Skeleton } from "~/components/ui/skeleton"; import { useGetFiatAmount } from "~/hooks/useGetFiatAmount"; +import { DEFAULT_WALLET_NAME } from "~/lib/constants"; +import { useAppStore } from "~/lib/state/appStore"; dayjs.extend(relativeTime); @@ -39,6 +41,8 @@ export function Home() { const [balanceState, setBalanceState] = useState( BalanceState.SATS, ); + const wallets = useAppStore((store) => store.wallets); + const selectedWalletId = useAppStore((store) => store.selectedWalletId); useFocusEffect(() => { reloadBalance(); @@ -89,6 +93,21 @@ export function Home() { onPress={switchBalanceState} className="w-full flex flex-col items-center justify-center gap-4" > + {wallets.length && ( + { + router.push("/settings/wallets"); + }} + > + + {wallets[selectedWalletId].name || DEFAULT_WALLET_NAME} + + + )} {balance && !refreshingBalance ? ( <> @@ -107,7 +126,7 @@ export function Home() { ) : ( - + )} @@ -122,7 +141,7 @@ export function Home() { ) + " sats"} ) : ( - + )}