import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import { ALERT_STATE } from '../../../../ducks/alerts'; import { dismissAlert, getAlertState, getNetworkName, } from '../../../../ducks/alerts/invalid-custom-network'; import Popover from '../../../ui/popover'; import Button from '../../../ui/button'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import { NETWORKS_ROUTE } from '../../../../helpers/constants/routes'; const { ERROR, LOADING } = ALERT_STATE; const InvalidCustomNetworkAlert = ({ history }) => { const t = useI18nContext(); const dispatch = useDispatch(); const alertState = useSelector(getAlertState); const networkName = useSelector(getNetworkName); const onClose = () => dispatch(dismissAlert()); const footer = ( <> {alertState === ERROR ? (
{t('invalidCustomNetworkAlertContent1', [networkName])}
{t('invalidCustomNetworkAlertContent2')}
{t('invalidCustomNetworkAlertContent3', [ global.platform.openTab({ url: 'https://chainid.network' }) } > chainId.network , ])}