import React, { useContext } from 'react'; import { useHistory } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import Box from '../../../components/ui/box'; import Typography from '../../../components/ui/typography'; import Button from '../../../components/ui/button'; import { FONT_WEIGHT, TEXT_ALIGN, TYPOGRAPHY, ALIGN_ITEMS, } from '../../../helpers/constants/design-system'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { ONBOARDING_PIN_EXTENSION_ROUTE, ONBOARDING_PRIVACY_SETTINGS_ROUTE, } from '../../../helpers/constants/routes'; import { setCompletedOnboarding } from '../../../store/actions'; import { getFirstTimeFlowType } from '../../../selectors'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { EVENT } from '../../../../shared/constants/metametrics'; export default function CreationSuccessful() { const firstTimeFlowTypeNameMap = { create: 'New Wallet Created', import: 'New Wallet Imported', }; const history = useHistory(); const t = useI18nContext(); const dispatch = useDispatch(); const firstTimeFlowType = useSelector(getFirstTimeFlowType); const trackEvent = useContext(MetaMetricsContext); const onComplete = async () => { await dispatch(setCompletedOnboarding()); trackEvent({ event: firstTimeFlowTypeNameMap[firstTimeFlowType], category: EVENT.CATEGORIES.ONBOARDING, properties: { action: 'Onboarding Complete', legacy_event: true, }, }); history.push(ONBOARDING_PIN_EXTENSION_ROUTE); }; return (
{t('walletCreationSuccessTitle')} {t('walletCreationSuccessDetail')} {t('remember')}
); }