Skip to content

Commit 7968f83

Browse files
committed
remove social wallet options
1 parent d9cc328 commit 7968f83

File tree

2 files changed

+104
-106
lines changed

2 files changed

+104
-106
lines changed

src/constants/wallets.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ import { type WalletType as CosmosWalletType } from 'graz';
33
import { type EIP6963ProviderInfo } from 'mipd';
44

55
import { STRING_KEYS } from '@/constants/localization';
6-
import { LoginMethod } from '@/types/turnkey';
76

7+
// import { LoginMethod } from '@/types/turnkey';
88
import {
99
CoinbaseIcon, // EmailIcon,
1010
GenericWalletIcon,
1111
KeplrIcon,
1212
MetaMaskIcon,
1313
OkxWalletIcon,
14-
PhantomIcon,
15-
PrivyIcon,
14+
PhantomIcon, // PrivyIcon,
1615
WalletConnectIcon,
1716
} from '@/icons';
1817

@@ -60,10 +59,10 @@ export enum WalletType {
6059
WalletConnect2 = 'WALLETCONNECT_2',
6160
TestWallet = 'TEST_WALLET',
6261
OtherWallet = 'OTHER_WALLET',
63-
Privy = 'PRIVY',
62+
// Privy = 'PRIVY',
6463
Phantom = 'PHANTOM',
6564
MetaMask = 'METAMASK',
66-
Turnkey = 'TURNKEY',
65+
// Turnkey = 'TURNKEY',
6766
}
6867

6968
export enum ConnectorType {
@@ -74,9 +73,9 @@ export enum ConnectorType {
7473
WalletConnect = 'walletConnect',
7574
Cosmos = 'cosmos',
7675
Test = 'test',
77-
Privy = 'privy',
76+
// Privy = 'privy',
7877
PhantomSolana = 'phantomSolana',
79-
Turnkey = 'turnkey',
78+
// Turnkey = 'turnkey',
8079
}
8180

8281
export enum WalletNetworkType {
@@ -94,18 +93,18 @@ export type WalletInfo =
9493
connectorType:
9594
| ConnectorType.Coinbase
9695
| ConnectorType.WalletConnect
97-
| ConnectorType.PhantomSolana
98-
| ConnectorType.Privy;
96+
| ConnectorType.PhantomSolana;
97+
// | ConnectorType.Privy;
9998
name: WalletType;
10099
}
101-
| {
102-
connectorType: ConnectorType.Turnkey;
103-
name: WalletType.Turnkey;
104-
userEmail?: string;
105-
providerName?: string;
106-
loginMethod: LoginMethod;
107-
requiresAddressUpload?: boolean;
108-
}
100+
// | {
101+
// connectorType: ConnectorType.Turnkey;
102+
// name: WalletType.Turnkey;
103+
// userEmail?: string;
104+
// providerName?: string;
105+
// loginMethod: LoginMethod;
106+
// requiresAddressUpload?: boolean;
107+
// }
109108
| {
110109
connectorType: ConnectorType.Cosmos;
111110
name: CosmosWalletType;
@@ -145,11 +144,11 @@ export const wallets = {
145144
stringKey: STRING_KEYS.TEST_WALLET,
146145
icon: GenericWalletIcon,
147146
},
148-
[WalletType.Privy]: {
149-
type: WalletType.Privy,
150-
stringKey: STRING_KEYS.PRIVY,
151-
icon: PrivyIcon,
152-
},
147+
// [WalletType.Privy]: {
148+
// type: WalletType.Privy,
149+
// stringKey: STRING_KEYS.PRIVY,
150+
// icon: PrivyIcon,
151+
// },
153152
[WalletType.Phantom]: {
154153
type: WalletType.Phantom,
155154
stringKey: STRING_KEYS.PHANTOM_SOL,

src/views/menus/AccountMenu/AccountMenu.tsx

Lines changed: 83 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ElementType, useMemo } from 'react';
1+
import { useMemo } from 'react';
22

33
import { BonsaiCore } from '@/bonsai/ontology';
4-
import { useMfaEnrollment, usePrivy } from '@privy-io/react-auth';
4+
// import { useMfaEnrollment } from '@privy-io/react-auth';
55
import { LAMPORTS_PER_SOL } from '@solana/web3.js';
66
import styled, { css } from 'styled-components';
77
import tw from 'twin.macro';
@@ -13,21 +13,20 @@ import { STRING_KEYS } from '@/constants/localization';
1313
import { isDev } from '@/constants/networks';
1414
import { SMALL_USD_DECIMALS, USD_DECIMALS } from '@/constants/numbers';
1515
import { StatsigFlags } from '@/constants/statsig';
16-
import { ConnectorType, DydxChainAsset, wallets, WalletType } from '@/constants/wallets';
16+
import { DydxChainAsset, WalletType } from '@/constants/wallets';
1717

1818
import { useAccountBalance } from '@/hooks/useAccountBalance';
1919
import { useAccounts } from '@/hooks/useAccounts';
2020
import { useBreakpoints } from '@/hooks/useBreakpoints';
2121
import { useEnableSpot } from '@/hooks/useEnableSpot';
2222
import { useEnvFeatures } from '@/hooks/useEnvFeatures';
23-
import { useMobileAppUrl } from '@/hooks/useMobileAppUrl';
2423
import { usePerpetualsComplianceState } from '@/hooks/usePerpetualsComplianceState';
2524
import { useStatsigGateValue } from '@/hooks/useStatsig';
2625
import { useStringGetter } from '@/hooks/useStringGetter';
2726
import { useSubaccount } from '@/hooks/useSubaccount';
2827
import { useTokenConfigs } from '@/hooks/useTokenConfigs';
2928

30-
import { AppleIcon, AppleLightIcon, DiscordIcon, GoogleIcon, TwitterIcon } from '@/icons';
29+
// import { AppleIcon, AppleLightIcon, DiscordIcon, GoogleIcon, TwitterIcon } from '@/icons';
3130
import { headerMixins } from '@/styles/headerMixins';
3231
import { layoutMixins } from '@/styles/layoutMixins';
3332

@@ -88,12 +87,12 @@ export const AccountMenu = () => {
8887
} = useAccounts();
8988
const { registerAffiliate } = useSubaccount();
9089

91-
const privy = usePrivy();
92-
const { google, discord, twitter } = privy.user ?? {};
90+
// const privy = usePrivy();
91+
// const { google, discord, twitter } = privy.user ?? {};
9392

94-
const { showMfaEnrollmentModal } = useMfaEnrollment();
93+
// const { showMfaEnrollmentModal } = useMfaEnrollment();
9594

96-
const { appleAppStoreUrl, googlePlayStoreUrl } = useMobileAppUrl();
95+
// const { appleAppStoreUrl, googlePlayStoreUrl } = useMobileAppUrl();
9796

9897
const usedBalanceBN = MustBigNumber(usdcBalance);
9998

@@ -120,55 +119,55 @@ export const AccountMenu = () => {
120119
return null;
121120
}
122121

123-
if (
124-
onboardingState === OnboardingState.AccountConnected &&
125-
walletInfo.name === WalletType.Privy
126-
) {
127-
if (google) {
128-
return <Icon iconComponent={GoogleIcon as ElementType} />;
129-
}
130-
131-
if (discord) {
132-
return <Icon iconComponent={DiscordIcon as ElementType} />;
133-
}
134-
135-
if (twitter) {
136-
return <Icon iconComponent={TwitterIcon as ElementType} />;
137-
}
138-
139-
return (
140-
<Icon
141-
tw="rounded-[0.25rem]"
142-
iconComponent={wallets[WalletType.Privy].icon as ElementType}
143-
/>
144-
);
145-
}
146-
147-
if (
148-
onboardingState === OnboardingState.AccountConnected &&
149-
walletInfo.connectorType === ConnectorType.Turnkey
150-
) {
151-
if (walletInfo.providerName === 'google') {
152-
return <Icon iconComponent={GoogleIcon as ElementType} />;
153-
}
154-
155-
if (walletInfo.providerName === 'apple') {
156-
return (
157-
<Icon
158-
iconComponent={
159-
theme === AppTheme.Light
160-
? (AppleIcon as ElementType)
161-
: (AppleLightIcon as ElementType)
162-
}
163-
/>
164-
);
165-
}
166-
167-
return <Icon iconComponent={wallets[WalletType.Turnkey].icon as ElementType} />;
168-
}
122+
// if (
123+
// onboardingState === OnboardingState.AccountConnected &&
124+
// walletInfo.name === WalletType.Privy
125+
// ) {
126+
// if (google) {
127+
// return <Icon iconComponent={GoogleIcon as ElementType} />;
128+
// }
129+
130+
// if (discord) {
131+
// return <Icon iconComponent={DiscordIcon as ElementType} />;
132+
// }
133+
134+
// if (twitter) {
135+
// return <Icon iconComponent={TwitterIcon as ElementType} />;
136+
// }
137+
138+
// return (
139+
// <Icon
140+
// tw="rounded-[0.25rem]"
141+
// iconComponent={wallets[WalletType.Privy].icon as ElementType}
142+
// />
143+
// );
144+
// }
145+
146+
// if (
147+
// onboardingState === OnboardingState.AccountConnected &&
148+
// walletInfo.connectorType === ConnectorType.Turnkey
149+
// ) {
150+
// if (walletInfo.providerName === 'google') {
151+
// return <Icon iconComponent={GoogleIcon as ElementType} />;
152+
// }
153+
154+
// if (walletInfo.providerName === 'apple') {
155+
// return (
156+
// <Icon
157+
// iconComponent={
158+
// theme === AppTheme.Light
159+
// ? (AppleIcon as ElementType)
160+
// : (AppleLightIcon as ElementType)
161+
// }
162+
// />
163+
// );
164+
// }
165+
166+
// return <Icon iconComponent={wallets[WalletType.Turnkey].icon as ElementType} />;
167+
// }
169168

170169
return <WalletIcon wallet={walletInfo} />;
171-
}, [onboardingState, walletInfo, google, discord, twitter, theme]);
170+
}, [onboardingState, walletInfo, theme]);
172171

173172
return onboardingState === OnboardingState.Disconnected ? (
174173
<OnboardingTriggerButton size={ButtonSize.XSmall} />
@@ -398,24 +397,24 @@ export const AccountMenu = () => {
398397
},
399398
]
400399
: []),
401-
...((appleAppStoreUrl ?? googlePlayStoreUrl)
402-
? [
403-
{
404-
value: 'MobileDownload',
405-
icon: <Icon iconName={IconName.Qr} />,
406-
label: stringGetter({ key: STRING_KEYS.DOWNLOAD_MOBILE_APP }),
407-
onSelect: () => {
408-
dispatch(
409-
openDialog(
410-
DialogTypes.MobileDownload({
411-
mobileAppUrl: (appleAppStoreUrl ?? googlePlayStoreUrl)!,
412-
})
413-
)
414-
);
415-
},
416-
},
417-
]
418-
: []),
400+
// ...((appleAppStoreUrl ?? googlePlayStoreUrl)
401+
// ? [
402+
// {
403+
// value: 'MobileDownload',
404+
// icon: <Icon iconName={IconName.Qr} />,
405+
// label: stringGetter({ key: STRING_KEYS.DOWNLOAD_MOBILE_APP }),
406+
// onSelect: () => {
407+
// dispatch(
408+
// openDialog(
409+
// DialogTypes.MobileDownload({
410+
// mobileAppUrl: (appleAppStoreUrl ?? googlePlayStoreUrl)!,
411+
// })
412+
// )
413+
// );
414+
// },
415+
// },
416+
// ]
417+
// : []),
419418
onboardingState === OnboardingState.AccountConnected &&
420419
hdKey && {
421420
value: 'MobileQrSignIn',
@@ -432,16 +431,16 @@ export const AccountMenu = () => {
432431
highlightColor: 'destroy' as const,
433432
onSelect: () => dispatch(openDialog(DialogTypes.MnemonicExport())),
434433
},
435-
...(privy.ready && privy.authenticated
436-
? [
437-
{
438-
value: 'MFA',
439-
icon: <Icon iconName={IconName.Lock} />,
440-
label: stringGetter({ key: STRING_KEYS.MULTI_FACTOR_AUTH }),
441-
onSelect: () => showMfaEnrollmentModal(),
442-
},
443-
]
444-
: []),
434+
// ...(privy.ready && privy.authenticated
435+
// ? [
436+
// {
437+
// value: 'MFA',
438+
// icon: <Icon iconName={IconName.Lock} />,
439+
// label: stringGetter({ key: STRING_KEYS.MULTI_FACTOR_AUTH }),
440+
// onSelect: () => showMfaEnrollmentModal(),
441+
// },
442+
// ]
443+
// : []),
445444
{
446445
value: 'Disconnect',
447446
icon: <Icon iconName={IconName.BoxClose} />,

0 commit comments

Comments
 (0)