import React, { useContext } from 'react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; import PropTypes from 'prop-types'; import { I18nContext } from '../../../contexts/i18n'; import { setSwapsErrorKey } from '../../../store/actions'; import Box from '../../../components/ui/box'; import { DISPLAY, AlignItems, TextVariant, FLEX_DIRECTION, TEXT_ALIGN, IconColor, } from '../../../helpers/constants/design-system'; import { Text, Icon, IconName } from '../../../components/component-library'; import { PREPARE_SWAP_ROUTE } from '../../../helpers/constants/routes'; import SwapsFooter from '../swaps-footer'; import { QUOTES_EXPIRED_ERROR } from '../../../../shared/constants/swaps'; export default function NotificationPage({ notificationKey }) { const t = useContext(I18nContext); const history = useHistory(); const dispatch = useDispatch(); // TODO: Either add default values or redirect a user out if a notificationKey value is not supported. let title = ''; let description = ''; let buttonText = ''; if (notificationKey === QUOTES_EXPIRED_ERROR) { title = t('swapAreYouStillThere'); description = t('swapAreYouStillThereDescription'); buttonText = t('swapShowLatestQuotes'); } return (