import React, { useState, useContext } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { TextAlign, TextVariant, JustifyContent, BackgroundColor, BorderRadius, AlignItems, FlexDirection, Display, BlockSize, } from '../../../helpers/constants/design-system'; import { ThreeStepProgressBar, threeStepStages, } from '../../../components/app/step-progress-bar'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { ONBOARDING_REVIEW_SRP_ROUTE } from '../../../helpers/constants/routes'; import { getCurrentLocale } from '../../../ducks/locale/locale'; import { MetaMetricsEventCategory, MetaMetricsEventName, } from '../../../../shared/constants/metametrics'; import { Box, Button, BUTTON_VARIANT, BUTTON_SIZES, Text, } from '../../../components/component-library'; import SkipSRPBackup from './skip-srp-backup-popover'; export default function SecureYourWallet() { const history = useHistory(); const t = useI18nContext(); const { search } = useLocation(); const currentLocale = useSelector(getCurrentLocale); const [showSkipSRPBackupPopover, setShowSkipSRPBackupPopover] = useState(false); const searchParams = new URLSearchParams(search); const isFromReminderParam = searchParams.get('isFromReminder') ? '/?isFromReminder=true' : ''; const trackEvent = useContext(MetaMetricsContext); const handleClickRecommended = () => { trackEvent({ category: MetaMetricsEventCategory.Onboarding, event: MetaMetricsEventName.OnboardingWalletSecurityStarted, }); history.push(`${ONBOARDING_REVIEW_SRP_ROUTE}${isFromReminderParam}`); }; const handleClickNotRecommended = () => { trackEvent({ category: MetaMetricsEventCategory.Onboarding, event: MetaMetricsEventName.OnboardingWalletSecuritySkipInitiated, }); setShowSkipSRPBackupPopover(true); }; const subtitles = { en: 'English', es: 'Spanish', hi: 'Hindi', id: 'Indonesian', ja: 'Japanese', ko: 'Korean', pt: 'Portuguese', ru: 'Russian', tl: 'Tagalog', vi: 'Vietnamese', de: 'German', el: 'Greek', fr: 'French', tr: 'Turkish', zh: 'Chinese - China', }; const defaultLang = subtitles[currentLocale] ? currentLocale : 'en'; return ( {showSkipSRPBackupPopover && ( setShowSkipSRPBackupPopover(false)} /> )} {t('seedPhraseIntroTitle')} {t('seedPhraseIntroTitleCopy')} { trackEvent({ category: MetaMetricsEventCategory.Onboarding, event: MetaMetricsEventName.OnboardingWalletVideoPlay, }); }} controls > {Object.keys(subtitles).map((key) => { return ( ); })} {t('seedPhraseIntroSidebarTitleOne')} {t('seedPhraseIntroSidebarCopyOne')} {t('seedPhraseIntroSidebarTitleTwo')} {t('seedPhraseIntroSidebarBulletOne')} {t('seedPhraseIntroSidebarBulletThree')} {t('seedPhraseIntroSidebarBulletFour')} {t('seedPhraseIntroSidebarTitleThree')} {t('seedPhraseIntroSidebarCopyTwo')} {t('seedPhraseIntroSidebarCopyThree')} ); }