2023-01-13 17:11:27 +01:00
|
|
|
import React, { useContext } from 'react';
|
2021-10-11 16:43:25 +02:00
|
|
|
import { useHistory } from 'react-router-dom';
|
2023-01-13 17:11:27 +01:00
|
|
|
import { useSelector } from 'react-redux';
|
2022-08-11 19:33:33 +02:00
|
|
|
|
2021-10-11 16:43:25 +02:00
|
|
|
import Box from '../../../components/ui/box';
|
|
|
|
import Typography from '../../../components/ui/typography';
|
|
|
|
import Button from '../../../components/ui/button';
|
|
|
|
import {
|
|
|
|
FONT_WEIGHT,
|
|
|
|
TEXT_ALIGN,
|
2023-02-02 21:15:26 +01:00
|
|
|
TypographyVariant,
|
|
|
|
AlignItems,
|
2021-10-11 16:43:25 +02:00
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
|
|
import {
|
|
|
|
ONBOARDING_PIN_EXTENSION_ROUTE,
|
|
|
|
ONBOARDING_PRIVACY_SETTINGS_ROUTE,
|
|
|
|
} from '../../../helpers/constants/routes';
|
2022-11-09 23:15:44 +01:00
|
|
|
import { isBeta } from '../../../helpers/utils/build-types';
|
2023-01-13 17:11:27 +01:00
|
|
|
import { getFirstTimeFlowType } from '../../../selectors';
|
2023-04-03 17:31:04 +02:00
|
|
|
import {
|
|
|
|
MetaMetricsEventCategory,
|
|
|
|
MetaMetricsEventName,
|
|
|
|
} from '../../../../shared/constants/metametrics';
|
2023-01-13 17:11:27 +01:00
|
|
|
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
2021-10-11 16:43:25 +02:00
|
|
|
|
|
|
|
export default function CreationSuccessful() {
|
|
|
|
const history = useHistory();
|
|
|
|
const t = useI18nContext();
|
2023-01-13 17:11:27 +01:00
|
|
|
const trackEvent = useContext(MetaMetricsContext);
|
|
|
|
const firstTimeFlowType = useSelector(getFirstTimeFlowType);
|
2021-10-15 20:52:52 +02:00
|
|
|
|
2021-10-11 16:43:25 +02:00
|
|
|
return (
|
2022-08-31 01:53:24 +02:00
|
|
|
<div className="creation-successful" data-testid="creation-successful">
|
2022-05-16 20:38:04 +02:00
|
|
|
<Box textAlign={TEXT_ALIGN.CENTER}>
|
2021-10-11 16:43:25 +02:00
|
|
|
<img src="./images/tada.png" />
|
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
variant={TypographyVariant.H2}
|
2021-10-11 16:43:25 +02:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
margin={6}
|
|
|
|
>
|
|
|
|
{t('walletCreationSuccessTitle')}
|
|
|
|
</Typography>
|
2023-02-02 21:15:26 +01:00
|
|
|
<Typography variant={TypographyVariant.H4}>
|
2021-10-11 16:43:25 +02:00
|
|
|
{t('walletCreationSuccessDetail')}
|
|
|
|
</Typography>
|
|
|
|
</Box>
|
2022-05-16 20:38:04 +02:00
|
|
|
<Typography
|
2023-02-02 21:15:26 +01:00
|
|
|
variant={TypographyVariant.H4}
|
|
|
|
boxProps={{ align: AlignItems.flexStart }}
|
2022-05-16 20:38:04 +02:00
|
|
|
marginLeft={12}
|
|
|
|
>
|
|
|
|
{t('remember')}
|
|
|
|
</Typography>
|
2021-10-11 16:43:25 +02:00
|
|
|
<ul>
|
|
|
|
<li>
|
2023-02-02 21:15:26 +01:00
|
|
|
<Typography variant={TypographyVariant.H4}>
|
2022-11-09 23:15:44 +01:00
|
|
|
{isBeta()
|
|
|
|
? t('betaWalletCreationSuccessReminder1')
|
|
|
|
: t('walletCreationSuccessReminder1')}
|
2021-10-11 16:43:25 +02:00
|
|
|
</Typography>
|
|
|
|
</li>
|
|
|
|
<li>
|
2023-02-02 21:15:26 +01:00
|
|
|
<Typography variant={TypographyVariant.H4}>
|
2022-11-09 23:15:44 +01:00
|
|
|
{isBeta()
|
|
|
|
? t('betaWalletCreationSuccessReminder2')
|
|
|
|
: t('walletCreationSuccessReminder2')}
|
2021-10-11 16:43:25 +02:00
|
|
|
</Typography>
|
|
|
|
</li>
|
|
|
|
<li>
|
2023-02-02 21:15:26 +01:00
|
|
|
<Typography variant={TypographyVariant.H4}>
|
2021-10-11 16:43:25 +02:00
|
|
|
{t('walletCreationSuccessReminder3', [
|
|
|
|
<span
|
|
|
|
key="creation-successful__bold"
|
|
|
|
className="creation-successful__bold"
|
|
|
|
>
|
|
|
|
{t('walletCreationSuccessReminder3BoldSection')}
|
|
|
|
</span>,
|
|
|
|
])}
|
|
|
|
</Typography>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<Button
|
|
|
|
href="https://community.metamask.io/t/what-is-a-secret-recovery-phrase-and-how-to-keep-your-crypto-wallet-secure/3440"
|
|
|
|
target="_blank"
|
|
|
|
type="link"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
2022-02-23 17:41:06 +01:00
|
|
|
{t('learnMoreUpperCase')}
|
2021-10-11 16:43:25 +02:00
|
|
|
</Button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<Box marginTop={6} className="creation-successful__actions">
|
|
|
|
<Button
|
|
|
|
type="link"
|
|
|
|
onClick={() => history.push(ONBOARDING_PRIVACY_SETTINGS_ROUTE)}
|
|
|
|
>
|
2022-12-08 15:20:59 +01:00
|
|
|
{t('advancedConfiguration')}
|
2021-10-11 16:43:25 +02:00
|
|
|
</Button>
|
2021-11-10 18:27:10 +01:00
|
|
|
<Button
|
|
|
|
data-testid="onboarding-complete-done"
|
|
|
|
type="primary"
|
|
|
|
large
|
|
|
|
rounded
|
2023-01-13 17:11:27 +01:00
|
|
|
onClick={() => {
|
|
|
|
trackEvent({
|
2023-04-03 17:31:04 +02:00
|
|
|
category: MetaMetricsEventCategory.Onboarding,
|
|
|
|
event: MetaMetricsEventName.OnboardingWalletCreationComplete,
|
2023-01-13 17:11:27 +01:00
|
|
|
properties: {
|
|
|
|
method: firstTimeFlowType,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
history.push(ONBOARDING_PIN_EXTENSION_ROUTE);
|
|
|
|
}}
|
2021-11-10 18:27:10 +01:00
|
|
|
>
|
2022-02-23 17:41:06 +01:00
|
|
|
{t('gotIt')}
|
2021-10-11 16:43:25 +02:00
|
|
|
</Button>
|
|
|
|
</Box>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|