2021-10-06 20:52:25 +02:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
import { useHistory } from 'react-router-dom';
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import Box from '../../../components/ui/box';
|
|
|
|
import Button from '../../../components/ui/button';
|
|
|
|
import Typography from '../../../components/ui/typography';
|
|
|
|
import {
|
|
|
|
TEXT_ALIGN,
|
|
|
|
TYPOGRAPHY,
|
|
|
|
JUSTIFY_CONTENT,
|
|
|
|
FONT_WEIGHT,
|
2022-02-23 17:36:58 +01:00
|
|
|
DISPLAY,
|
2021-10-06 20:52:25 +02:00
|
|
|
} from '../../../helpers/constants/design-system';
|
2021-10-13 19:41:24 +02:00
|
|
|
import {
|
|
|
|
ThreeStepProgressBar,
|
|
|
|
threeStepStages,
|
|
|
|
} from '../../../components/app/step-progress-bar';
|
2021-10-06 20:52:25 +02:00
|
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
|
|
import { ONBOARDING_REVIEW_SRP_ROUTE } from '../../../helpers/constants/routes';
|
|
|
|
import { getCurrentLocale } from '../../../ducks/metamask/metamask';
|
|
|
|
import SkipSRPBackup from './skip-srp-backup-popover';
|
|
|
|
|
|
|
|
export default function SecureYourWallet() {
|
|
|
|
const history = useHistory();
|
|
|
|
const t = useI18nContext();
|
|
|
|
const currentLocale = useSelector(getCurrentLocale);
|
2022-07-31 20:26:40 +02:00
|
|
|
const [showSkipSRPBackupPopover, setShowSkipSRPBackupPopover] =
|
|
|
|
useState(false);
|
2021-10-06 20:52:25 +02:00
|
|
|
|
|
|
|
const handleClickRecommended = () => {
|
|
|
|
history.push(ONBOARDING_REVIEW_SRP_ROUTE);
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleClickNotRecommended = () => {
|
|
|
|
setShowSkipSRPBackupPopover(true);
|
|
|
|
};
|
|
|
|
|
|
|
|
const subtitles = {
|
|
|
|
en: 'English',
|
|
|
|
es: 'Spanish',
|
|
|
|
hi: 'Hindi',
|
|
|
|
id: 'Indonesian',
|
|
|
|
ja: 'Japanese',
|
|
|
|
ko: 'Korean',
|
|
|
|
pt: 'Portuguese',
|
|
|
|
ru: 'Russian',
|
|
|
|
tl: 'Tagalog',
|
|
|
|
vi: 'Vietnamese',
|
2022-06-17 20:55:04 +02:00
|
|
|
de: 'German',
|
|
|
|
el: 'Greek',
|
|
|
|
fr: 'French',
|
|
|
|
tr: 'Turkish',
|
|
|
|
zh: 'Chinese - China',
|
2021-10-06 20:52:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const defaultLang = subtitles[currentLocale] ? currentLocale : 'en';
|
|
|
|
return (
|
|
|
|
<div className="secure-your-wallet">
|
|
|
|
{showSkipSRPBackupPopover && (
|
|
|
|
<SkipSRPBackup handleClose={() => setShowSkipSRPBackupPopover(false)} />
|
|
|
|
)}
|
2022-05-16 20:38:04 +02:00
|
|
|
<ThreeStepProgressBar
|
|
|
|
stage={threeStepStages.RECOVERY_PHRASE_VIDEO}
|
|
|
|
marginBottom={4}
|
|
|
|
/>
|
2021-10-06 20:52:25 +02:00
|
|
|
<Box
|
|
|
|
justifyContent={JUSTIFY_CONTENT.CENTER}
|
|
|
|
textAlign={TEXT_ALIGN.CENTER}
|
|
|
|
marginBottom={4}
|
|
|
|
>
|
|
|
|
<Typography variant={TYPOGRAPHY.H2} fontWeight={FONT_WEIGHT.BOLD}>
|
|
|
|
{t('seedPhraseIntroTitle')}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
2022-02-23 17:36:58 +01:00
|
|
|
<Box justifyContent={JUSTIFY_CONTENT.CENTER} marginBottom={6}>
|
2021-10-06 20:52:25 +02:00
|
|
|
<Typography
|
|
|
|
variant={TYPOGRAPHY.H4}
|
|
|
|
className="secure-your-wallet__details"
|
|
|
|
>
|
|
|
|
{t('seedPhraseIntroTitleCopy')}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
|
|
|
<Box>
|
2022-05-16 20:38:04 +02:00
|
|
|
<video className="secure-your-wallet__video" controls>
|
2021-10-06 20:52:25 +02:00
|
|
|
<source
|
|
|
|
type="video/webm"
|
|
|
|
src="./images/videos/recovery-onboarding/video.webm"
|
|
|
|
/>
|
|
|
|
{Object.keys(subtitles).map((key) => {
|
|
|
|
return (
|
|
|
|
<track
|
|
|
|
default={Boolean(key === defaultLang)}
|
|
|
|
srcLang={key}
|
|
|
|
label={subtitles[key]}
|
|
|
|
key={`${key}-subtitles`}
|
|
|
|
kind="subtitles"
|
|
|
|
src={`./images/videos/recovery-onboarding/subtitles/${key}.vtt`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</video>
|
|
|
|
</Box>
|
|
|
|
<Box
|
|
|
|
margin={8}
|
|
|
|
justifyContent={JUSTIFY_CONTENT.SPACE_BETWEEN}
|
|
|
|
className="secure-your-wallet__actions"
|
|
|
|
>
|
|
|
|
<Button
|
2021-11-10 18:27:10 +01:00
|
|
|
data-testid="secure-wallet-later"
|
2021-10-06 20:52:25 +02:00
|
|
|
type="secondary"
|
|
|
|
rounded
|
|
|
|
large
|
|
|
|
onClick={handleClickNotRecommended}
|
|
|
|
>
|
|
|
|
{t('seedPhraseIntroNotRecommendedButtonCopy')}
|
|
|
|
</Button>
|
2021-11-10 18:27:10 +01:00
|
|
|
<Button
|
|
|
|
data-testid="secure-wallet-recommended"
|
|
|
|
type="primary"
|
|
|
|
rounded
|
|
|
|
large
|
|
|
|
onClick={handleClickRecommended}
|
|
|
|
>
|
2021-10-06 20:52:25 +02:00
|
|
|
{t('seedPhraseIntroRecommendedButtonCopy')}
|
|
|
|
</Button>
|
|
|
|
</Box>
|
2022-05-16 20:38:04 +02:00
|
|
|
<Box className="secure-your-wallet__desc">
|
2022-02-23 17:36:58 +01:00
|
|
|
<Box marginBottom={4}>
|
|
|
|
<Typography
|
2022-08-10 21:42:42 +02:00
|
|
|
as="p"
|
2022-02-23 17:36:58 +01:00
|
|
|
variant={TYPOGRAPHY.H4}
|
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{ display: DISPLAY.BLOCK }}
|
|
|
|
>
|
|
|
|
{t('seedPhraseIntroSidebarTitleOne')}
|
|
|
|
</Typography>
|
2022-08-10 21:42:42 +02:00
|
|
|
<Typography as="p" variant={TYPOGRAPHY.H4}>
|
2022-02-23 17:36:58 +01:00
|
|
|
{t('seedPhraseIntroSidebarCopyOne')}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
|
|
|
<Box marginBottom={4}>
|
|
|
|
<Typography
|
2022-08-10 21:42:42 +02:00
|
|
|
as="p"
|
2022-02-23 17:36:58 +01:00
|
|
|
variant={TYPOGRAPHY.H4}
|
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{ display: DISPLAY.BLOCK }}
|
|
|
|
>
|
|
|
|
{t('seedPhraseIntroSidebarTitleTwo')}
|
|
|
|
</Typography>
|
|
|
|
<ul className="secure-your-wallet__list">
|
|
|
|
<li>{t('seedPhraseIntroSidebarBulletOne')}</li>
|
|
|
|
<li>{t('seedPhraseIntroSidebarBulletThree')}</li>
|
|
|
|
<li>{t('seedPhraseIntroSidebarBulletFour')}</li>
|
|
|
|
</ul>
|
|
|
|
</Box>
|
|
|
|
<Box marginBottom={6}>
|
|
|
|
<Typography
|
2022-08-10 21:42:42 +02:00
|
|
|
as="p"
|
2022-02-23 17:36:58 +01:00
|
|
|
variant={TYPOGRAPHY.H4}
|
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
boxProps={{ display: DISPLAY.BLOCK }}
|
|
|
|
>
|
|
|
|
{t('seedPhraseIntroSidebarTitleThree')}
|
|
|
|
</Typography>
|
2022-08-10 21:42:42 +02:00
|
|
|
<Typography as="p" variant={TYPOGRAPHY.H4}>
|
2022-02-23 17:36:58 +01:00
|
|
|
{t('seedPhraseIntroSidebarCopyTwo')}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
|
|
|
<Box className="secure-your-wallet__highlighted" marginBottom={2}>
|
2022-08-10 21:42:42 +02:00
|
|
|
<Typography as="p" variant={TYPOGRAPHY.H4}>
|
2022-02-23 17:36:58 +01:00
|
|
|
{t('seedPhraseIntroSidebarCopyThree')}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
2021-10-06 20:52:25 +02:00
|
|
|
</Box>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|