Skip to content

Commit c743a8f

Browse files
authored
feat: add account management/export to simple ui (#1913)
1 parent 7cb7dea commit c743a8f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/views/menus/UserMenuContent.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { calculateCanAccountTrade } from '@/state/accountCalculators';
2626
import { getOnboardingState } from '@/state/accountSelectors';
2727
import { useAppDispatch, useAppSelector } from '@/state/appTypes';
2828
import { openDialog } from '@/state/dialogs';
29+
import { selectIsTurnkeyConnected } from '@/state/walletSelectors';
2930

3031
import { isTruthy } from '@/lib/isTruthy';
3132
import { orEmptyObj } from '@/lib/typeUtils';
@@ -38,6 +39,7 @@ export const UserMenuContent = () => {
3839
const onboardingState = useAppSelector(getOnboardingState);
3940
const { complianceState } = useComplianceState();
4041
const canAccountTrade = useAppSelector(calculateCanAccountTrade);
42+
const isTurnkeyConnected = useAppSelector(selectIsTurnkeyConnected);
4143
const { equity, freeCollateral } = orEmptyObj(
4244
useAppSelector(BonsaiCore.account.parentSubaccountSummary.data)
4345
);
@@ -93,6 +95,24 @@ export const UserMenuContent = () => {
9395
dispatch(openDialog(DialogTypes.Help()));
9496
},
9597
},
98+
onboardingState === OnboardingState.AccountConnected &&
99+
(isTurnkeyConnected
100+
? {
101+
key: 'export-turnkey',
102+
label: stringGetter({ key: STRING_KEYS.ACCOUNT_MANAGEMENT }),
103+
icon: <Icon iconName={IconName.User} />,
104+
onClick: () => {
105+
dispatch(openDialog(DialogTypes.ManageAccount()));
106+
},
107+
}
108+
: {
109+
key: 'export-keys',
110+
label: stringGetter({ key: STRING_KEYS.EXPORT_DYDX_WALLET }),
111+
icon: <Icon iconName={IconName.ExportKeys} />,
112+
onClick: () => {
113+
dispatch(openDialog(DialogTypes.MnemonicExport()));
114+
},
115+
}),
96116
onboardingState !== OnboardingState.Disconnected && {
97117
key: 'disconnect-wallet',
98118
label: stringGetter({ key: STRING_KEYS.SIGN_OUT }),

0 commit comments

Comments
 (0)