import PropTypes from 'prop-types'; import React, { useContext } from 'react'; import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'; import Box from '../../../ui/box'; import { Text, Button, BUTTON_VARIANT, ButtonIcon, IconName, } from '../../../component-library'; import { AlignItems, DISPLAY, FLEX_DIRECTION, JustifyContent, Size, TextVariant, } from '../../../../helpers/constants/design-system'; import HoldToRevealButton from '../../hold-to-reveal-button'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import ZENDESK_URLS from '../../../../helpers/constants/zendesk-url'; import { MetaMetricsContext } from '../../../../contexts/metametrics'; import { MetaMetricsEventCategory, MetaMetricsEventKeyType, MetaMetricsEventName, } from '../../../../../shared/constants/metametrics'; const HoldToRevealModal = ({ onLongPressed, hideModal }) => { const t = useI18nContext(); const trackEvent = useContext(MetaMetricsContext); const unlock = () => { onLongPressed(); hideModal(); }; const handleCancel = () => { hideModal(); }; return ( {t('holdToRevealTitle')} { trackEvent({ category: MetaMetricsEventCategory.Keys, event: MetaMetricsEventName.SrpHoldToRevealCloseClicked, properties: { key_type: MetaMetricsEventKeyType.Srp, }, }); handleCancel(); }} ariaLabel={t('close')} /> {t('holdToRevealContent1', [ {t('holdToRevealContent2')} , ])} {t('holdToRevealContent3', [ {t('holdToRevealContent4')} , , ])} ); }; HoldToRevealModal.propTypes = { // The function to be executed after the hold to reveal long press has been completed onLongPressed: PropTypes.func.isRequired, hideModal: PropTypes.func, }; export default withModalProps(HoldToRevealModal);