Skip to content

Commit 692dbd3

Browse files
authored
style: Add qr sign in to top header (#1944)
1 parent b5632bd commit 692dbd3

File tree

5 files changed

+56
-55
lines changed

5 files changed

+56
-55
lines changed

src/constants/dialogs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export type ExternalNavKeplrDialogProps = {};
5353
export type ManageAccountDialogProps = {};
5454
export type MnemonicExportDialogProps = {};
5555
export type MobileDownloadDialogProps = { mobileAppUrl: string };
56-
export type MobileSignInDialogProps = {};
56+
export type MobileSignInDialogProps = { skipWaiting?: boolean };
5757
export type OnboardingDialogProps = {};
5858
export type OrderDetailsDialogProps = { orderId: string };
5959
export type PredictionMarketIntroDialogProps = {};

src/layout/Header/HeaderDesktop.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -193,37 +193,39 @@ export const HeaderDesktop = () => {
193193
<$NavAfter>
194194
{onboardingState === OnboardingState.AccountConnected &&
195195
complianceState === ComplianceStates.FULL_ACCESS && (
196-
<>
197-
<Button
198-
tw="mr-[0.5em]"
199-
shape={ButtonShape.Pill}
200-
size={ButtonSize.XSmall}
201-
action={
202-
!availableBalance || availableBalance > 0
203-
? ButtonAction.Secondary
204-
: ButtonAction.Primary
205-
}
206-
onClick={() => {
207-
dispatch(openDialog(DialogTypes.Deposit2({})));
208-
}}
209-
state={{ isDisabled: !dydxAccounts }}
210-
>
211-
{stringGetter({ key: STRING_KEYS.DEPOSIT })}
212-
</Button>
213-
<VerticalSeparator />
214-
</>
196+
<Button
197+
shape={ButtonShape.Pill}
198+
size={ButtonSize.XSmall}
199+
action={
200+
!availableBalance || availableBalance > 0
201+
? ButtonAction.Secondary
202+
: ButtonAction.Primary
203+
}
204+
onClick={() => {
205+
dispatch(openDialog(DialogTypes.Deposit2({})));
206+
}}
207+
state={{ isDisabled: !dydxAccounts }}
208+
>
209+
{stringGetter({ key: STRING_KEYS.DEPOSIT })}
210+
</Button>
215211
)}
216212

217-
<MobileDownloadLinks />
213+
{onboardingState === OnboardingState.AccountConnected ? (
214+
<$IconButton
215+
shape={ButtonShape.Rectangle}
216+
iconName={IconName.Mobile}
217+
onClick={() => dispatch(openDialog(DialogTypes.MobileSignIn({ skipWaiting: true })))}
218+
/>
219+
) : (
220+
<MobileDownloadLinks />
221+
)}
218222

219223
<$IconButton
220224
shape={ButtonShape.Rectangle}
221225
iconName={IconName.HelpCircle}
222226
onClick={() => dispatch(openDialog(DialogTypes.Help()))}
223227
/>
224228

225-
<VerticalSeparator />
226-
227229
<NotificationsMenu
228230
slotTrigger={
229231
<$IconButton
@@ -233,8 +235,6 @@ export const HeaderDesktop = () => {
233235
}
234236
/>
235237

236-
<VerticalSeparator />
237-
238238
<AccountMenu />
239239
</$NavAfter>
240240
</$Header>
@@ -316,7 +316,7 @@ const $NavAfter = styled.div`
316316
justify-self: end;
317317
padding: 0 0.75rem;
318318
319-
gap: 0.5rem;
319+
gap: 1rem;
320320
321321
a {
322322
color: var(--color-text-1);

src/views/MobileDownloadLinks.tsx

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { IconName } from '@/components/Icon';
1414
import { IconButton } from '@/components/IconButton';
1515
import { Link } from '@/components/Link';
1616
import { Popover, TriggerType } from '@/components/Popover';
17-
import { VerticalSeparator } from '@/components/Separator';
1817

1918
export const MobileDownloadLinks = ({ withBadges }: { withBadges?: boolean }) => {
2019
const stringGetter = useStringGetter();
@@ -41,31 +40,28 @@ export const MobileDownloadLinks = ({ withBadges }: { withBadges?: boolean }) =>
4140
}
4241

4342
return (
44-
<>
45-
<Popover
46-
triggerType={TriggerType.MobileDownloadTrigger}
47-
align="center"
48-
slotTrigger={<$IconButton iconName={IconName.Mobile} shape={ButtonShape.Square} />}
49-
sideOffset={8}
50-
>
51-
<$DownloadLinksInPopover>
52-
<div>{stringGetter({ key: STRING_KEYS.GET_DYDX_ON_PHONE })}</div>
53-
<div tw="row gap-0.5">
54-
{googlePlayStoreUrl && (
55-
<Link href={googlePlayStoreUrl}>
56-
<img tw="w-10" src="/play-store.png" alt="google-play" />
57-
</Link>
58-
)}
59-
{appleAppStoreUrl && (
60-
<Link href={appleAppStoreUrl}>
61-
<img tw="w-10" src="/app-store.png" alt="app-store" />
62-
</Link>
63-
)}
64-
</div>
65-
</$DownloadLinksInPopover>
66-
</Popover>
67-
<VerticalSeparator />
68-
</>
43+
<Popover
44+
triggerType={TriggerType.MobileDownloadTrigger}
45+
align="center"
46+
slotTrigger={<$IconButton iconName={IconName.Mobile} shape={ButtonShape.Square} />}
47+
sideOffset={8}
48+
>
49+
<$DownloadLinksInPopover>
50+
<div>{stringGetter({ key: STRING_KEYS.GET_DYDX_ON_PHONE })}</div>
51+
<div tw="row gap-0.5">
52+
{googlePlayStoreUrl && (
53+
<Link href={googlePlayStoreUrl}>
54+
<img tw="w-10" src="/play-store.png" alt="google-play" />
55+
</Link>
56+
)}
57+
{appleAppStoreUrl && (
58+
<Link href={appleAppStoreUrl}>
59+
<img tw="w-10" src="/app-store.png" alt="app-store" />
60+
</Link>
61+
)}
62+
</div>
63+
</$DownloadLinksInPopover>
64+
</Popover>
6965
);
7066
};
7167

src/views/dialogs/MobileSignInDialog.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ const MobileQrCode = ({
6969
);
7070
};
7171

72-
export const MobileSignInDialog = ({ setIsOpen }: DialogProps<MobileSignInDialogProps>) => {
73-
const [currentState, setCurrentState] = useState(MobileSignInState.Waiting);
72+
export const MobileSignInDialog = ({
73+
setIsOpen,
74+
skipWaiting = false,
75+
}: DialogProps<MobileSignInDialogProps>) => {
76+
const [currentState, setCurrentState] = useState(
77+
skipWaiting ? MobileSignInState.Scanning : MobileSignInState.Waiting
78+
);
7479
const [isScanning, setIsScanning] = useState(false);
7580
const stringGetter = useStringGetter();
7681

src/views/menus/AccountMenu/AccountMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export const AccountMenu = () => {
413413
value: 'MobileQrSignIn',
414414
icon: <Icon iconName={IconName.Qr} />,
415415
label: stringGetter({ key: STRING_KEYS.TITLE_SIGN_INTO_MOBILE }),
416-
onSelect: () => dispatch(openDialog(DialogTypes.MobileSignIn())),
416+
onSelect: () => dispatch(openDialog(DialogTypes.MobileSignIn({}))),
417417
},
418418
onboardingState === OnboardingState.AccountConnected &&
419419
hdKey &&

0 commit comments

Comments
 (0)