From 6127fe957c1ac2e26543ec03becd51a9b2cd08cb Mon Sep 17 00:00:00 2001 From: Giancarlo Buomprisco Date: Wed, 5 Feb 2025 13:46:50 +0700 Subject: [PATCH] Update TeamAccountsModal to include selected account prop and improve account switching (#142) --- .../team-account-layout-mobile-navigation.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/web/app/home/[account]/_components/team-account-layout-mobile-navigation.tsx b/apps/web/app/home/[account]/_components/team-account-layout-mobile-navigation.tsx index 6717c0884..a86019025 100644 --- a/apps/web/app/home/[account]/_components/team-account-layout-mobile-navigation.tsx +++ b/apps/web/app/home/[account]/_components/team-account-layout-mobile-navigation.tsx @@ -75,7 +75,11 @@ export const TeamAccountLayoutMobileNavigation = ( - + {Links} @@ -129,7 +133,11 @@ function SignOutDropdownItem( ); } -function TeamAccountsModal(props: { accounts: Accounts; userId: string }) { +function TeamAccountsModal(props: { + accounts: Accounts; + userId: string; + account: string; +}) { const router = useRouter(); return ( @@ -159,6 +167,9 @@ function TeamAccountsModal(props: { accounts: Accounts; userId: string }) { className={'w-full max-w-full'} collisionPadding={0} userId={props.userId} + accounts={props.accounts} + features={features} + selectedAccount={props.account} onAccountChange={(value) => { const path = value ? pathsConfig.app.accountHome.replace('[account]', value) @@ -166,8 +177,6 @@ function TeamAccountsModal(props: { accounts: Accounts; userId: string }) { router.replace(path); }} - accounts={props.accounts} - features={features} />