Skip to content

Commit 1a198d7

Browse files
authored
fix: refactor EarnHome navigation params and fix ListItem children (#7706)
Refactored EarnHome to build navigation parameters object before calling pushDetailPageFromDeeplink, ensuring 'vault' is only included if defined. Also updated TabSettingsListItem to render children prop, allowing for more flexible list item content.
1 parent fc4c815 commit 1a198d7

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

packages/kit/src/views/Earn/EarnHome.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,15 +819,28 @@ function BasicEarnHome() {
819819
accountId: account?.id ?? '',
820820
networkId,
821821
});
822-
void EarnNavigation.pushDetailPageFromDeeplink(navigation, {
822+
const navigationParams: {
823+
accountId?: string;
824+
networkId: string;
825+
indexedAccountId?: string;
826+
symbol: string;
827+
provider: string;
828+
vault?: string;
829+
} = {
823830
accountId: earnAccount?.accountId || account?.id || '',
824831
indexedAccountId:
825832
earnAccount?.account.indexedAccountId || indexedAccount?.id,
826833
provider,
827834
symbol,
828835
networkId,
829-
vault: vault ?? '',
830-
});
836+
};
837+
if (vault) {
838+
navigationParams.vault = vault;
839+
}
840+
void EarnNavigation.pushDetailPageFromDeeplink(
841+
navigation,
842+
navigationParams,
843+
);
831844
}
832845
return;
833846
}

packages/kit/src/views/Setting/pages/Tab/ListItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ export function TabSettingsSection(props: IStackProps & IStackStyle) {
3535

3636
export function TabSettingsListItem({
3737
showDot,
38+
children,
3839
...props
3940
}: IListItemProps & IStackStyle & IStackProps & { showDot?: boolean }) {
4041
return (
4142
<BaseListItem py="$3" px="$5" mx={0} borderRadius={0} {...props}>
43+
{children}
4244
{showDot ? (
4345
<Stack width="$2" height="$2" bg="$iconInfo" borderRadius="$full" />
4446
) : null}

0 commit comments

Comments
 (0)