From e73b71e2ae1b2b7704b4d1905b5fe3b3fef3eaf8 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Tue, 24 Dec 2024 10:53:40 +0530 Subject: [PATCH 1/2] feat: show active wallet name --- pages/Home.tsx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pages/Home.tsx b/pages/Home.tsx index cb7a7ab..dee7ebb 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 { @@ -24,6 +24,8 @@ import Screen from "~/components/Screen"; import { Button } from "~/components/ui/button"; 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); @@ -40,6 +42,8 @@ export function Home() { const [balanceState, setBalanceState] = useState( BalanceState.SATS, ); + const wallets = useAppStore((store) => store.wallets); + const selectedWalletId = useAppStore((store) => store.selectedWalletId); useFocusEffect(() => { reloadBalance(); @@ -90,6 +94,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 ? ( <> From ca81ae86c4456b20e79635516c1f9f594d631896 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Tue, 24 Dec 2024 19:07:26 +0530 Subject: [PATCH 2/2] chore: change skeleton height --- pages/Home.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/Home.tsx b/pages/Home.tsx index dee7ebb..237636f 100644 --- a/pages/Home.tsx +++ b/pages/Home.tsx @@ -127,7 +127,7 @@ export function Home() { ) : ( - + )} @@ -142,7 +142,7 @@ export function Home() { ) + " sats"} ) : ( - + )}