Skip to content

Commit 63df893

Browse files
NateIsernclaude
andcommitted
fix(home): Nodes→Pockets action pill + remove active-Pocket chip
Re-apply the requested home changes that a concurrent edit reverted: the "Nodes" action pill (→ /masternode) becomes "Pockets" (→ /pockets), and the active-Pocket chip under the balance is removed. Clean-cut the now-orphaned code — pocketSwitcherControl, activePocket/activePocketName, the pockets/ activeAccount/isWatchOnly selectors, the PocketSwitcherSheet dialog, and the HubIcon/PocketAvatar/PocketSwitcherSheet/findPocket imports. Pockets is now reached solely via the action pill; the pull-to-refresh hook extraction is preserved untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0963b5b commit 63df893

1 file changed

Lines changed: 3 additions & 57 deletions

File tree

app/(tabs)/index.tsx

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
ActionButton,
2323
EmptyState,
2424
Badge,
25-
PocketAvatar,
2625
} from "../../src/ui/components";
2726
import { TransactionItem } from "../../src/ui/components/TransactionItem";
2827
import {
@@ -31,11 +30,8 @@ import {
3130
} from "../../src/ui/components/SuggestionStack";
3231
import { HomeOverview } from "../../src/ui/components/HomeOverview";
3332
import { ArrowCircleDownIcon } from "../../src/ui/components/ArrowCircleDownIcon";
34-
import { HubIcon } from "../../src/ui/components/HubIcon";
3533
import { SendIcon } from "../../src/ui/components/SendIcon";
3634
import { WalletSwitcherSheet } from "../../src/ui/sheets/WalletSwitcherSheet";
37-
import { PocketSwitcherSheet } from "../../src/ui/sheets/PocketSwitcherSheet";
38-
import { findPocket, MAIN_POCKET_ACCOUNT } from "../../src/wallet/pockets";
3935
import { TransactionDetailSheet } from "../../src/ui/sheets/TransactionDetailSheet";
4036
import { RefreshRainbowBar } from "../../src/ui/components/RefreshRainbowBar";
4137
import { usePullToRefreshBand } from "../../src/hooks/usePullToRefreshBand";
@@ -140,9 +136,6 @@ export default function HomeScreen() {
140136
const receiveAddress = useWalletStore((s) => s.currentReceiveAddress);
141137
const refreshBalance = useWalletStore((s) => s.refreshBalance);
142138
const hasBackedUp = useWalletStore((s) => s.hasBackedUp);
143-
const pockets = useWalletStore((s) => s.pockets);
144-
const activeAccount = useWalletStore((s) => s.activeAccount);
145-
const isWatchOnly = useWalletStore((s) => s.isWatchOnly);
146139
const loadPockets = useWalletStore((s) => s.loadPockets);
147140

148141
const [price, setPrice] = useState<PriceData | null>(getCachedPrice);
@@ -154,16 +147,6 @@ export default function HomeScreen() {
154147
const [sheetMode, setSheetMode] = useState<"send" | "receive">("send");
155148
// Tapping the wallet name opens a quick wallet-switcher sheet.
156149
const walletSwitcherControl = useDialogControl();
157-
// Tapping the active-Pocket pill opens a quick Pocket-switcher sheet.
158-
const pocketSwitcherControl = useDialogControl();
159-
const activePocket = useMemo(
160-
() => findPocket(pockets, activeAccount),
161-
[pockets, activeAccount],
162-
);
163-
const activePocketName =
164-
!activePocket || activePocket.account === MAIN_POCKET_ACCOUNT
165-
? t("pockets.mainName")
166-
: activePocket.name;
167150
// Tapping an activity row opens the transaction detail in a bottom sheet.
168151
const txDetailControl = useDialogControl();
169152
const [detailTxid, setDetailTxid] = useState<string | null>(null);
@@ -340,33 +323,6 @@ export default function HomeScreen() {
340323
size="lg"
341324
align="start"
342325
/>
343-
{/* Active-Pocket pill — opens the Pocket switcher. Watch-only
344-
wallets have no Pockets, so the pill (and the whole Pockets
345-
surface) is hidden for them. */}
346-
{!isWatchOnly ? (
347-
<Pressable
348-
className="self-start flex-row items-center bg-surface rounded-full pl-1.5 pr-3 py-1.5 mt-2 active:opacity-70"
349-
onPress={() => pocketSwitcherControl.open()}
350-
accessibilityRole="button"
351-
accessibilityLabel={t("pockets.switcherTitle")}
352-
>
353-
{/* Omitted until the registry resolves the active Pocket — the
354-
pill still reads correctly from its name alone. */}
355-
{activePocket ? (
356-
<View className="mr-1.5">
357-
<PocketAvatar pocket={activePocket} size={20} />
358-
</View>
359-
) : null}
360-
<Text className="text-foreground text-sm font-medium">
361-
{activePocketName}
362-
</Text>
363-
<MaterialCommunityIcons
364-
name="chevron-down"
365-
size={16}
366-
color={theme.colors.textSecondary}
367-
/>
368-
</Pressable>
369-
) : null}
370326
</View>
371327

372328
{/* ---- Quick actions ---- */}
@@ -399,12 +355,9 @@ export default function HomeScreen() {
399355
onPress={handleBuy}
400356
/>
401357
<ActionButton
402-
icon="server-network"
403-
label={t("wallet.nodes")}
404-
onPress={() => router.push("/masternode")}
405-
renderIcon={({ color, size }) => (
406-
<HubIcon color={color} size={size} />
407-
)}
358+
icon="wallet-bifold-outline"
359+
label={t("pockets.title")}
360+
onPress={() => router.push("/pockets")}
408361
/>
409362
</View>
410363

@@ -496,13 +449,6 @@ export default function HomeScreen() {
496449
>
497450
<WalletSwitcherSheet onDone={() => walletSwitcherControl.close()} />
498451
</Dialog>
499-
<Dialog
500-
control={pocketSwitcherControl}
501-
placement="bottom"
502-
title={t("pockets.switcherTitle")}
503-
>
504-
<PocketSwitcherSheet onDone={() => pocketSwitcherControl.close()} />
505-
</Dialog>
506452
<Dialog
507453
control={txDetailControl}
508454
placement="bottom"

0 commit comments

Comments
 (0)