import React, { useState, useContext } from 'react'; import { useHistory, useLocation } 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, TypographyVariant, JustifyContent, FONT_WEIGHT, DISPLAY, } 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 { EVENT_NAMES, EVENT } from '../../../../shared/constants/metametrics'; 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: EVENT.CATEGORIES.ONBOARDING, event: EVENT_NAMES.ONBOARDING_WALLET_SECURITY_STARTED, }); history.push(`${ONBOARDING_REVIEW_SRP_ROUTE}${isFromReminderParam}`); }; const handleClickNotRecommended = () => { trackEvent({ category: EVENT.CATEGORIES.ONBOARDING, event: EVENT_NAMES.ONBOARDING_WALLET_SECURITY_SKIP_INITIATED, }); 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 (