import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { Button, Dialog, DialogActions, DialogContent, DialogTitle, DialogContentText } from '@material-ui/core'; import { fromGeneralActions, fromGeneralSelectors } from '../../features/general'; import { fromUsersSelectors } from '../../features/users'; export const AccountMismatchModal = () => { const { visibility } = useSelector(fromGeneralSelectors.getAccountMismatchModalProperties); const user = useSelector(fromUsersSelectors.getUserOffchain); const activeBlockchainAddress = useSelector( fromUsersSelectors.getActiveBlockchainAccountAddress ); const dispatch = useDispatch(); const { t } = useTranslation(); const handleClose = () => dispatch( fromGeneralActions.setAccountMismatchModalProperties({ visibility: false }) ); const submit = () => { dispatch(fromGeneralActions.accountMismatchModalResolved(true)); handleClose(); }; const cancel = () => { dispatch(fromGeneralActions.accountMismatchModalResolved(false)); handleClose(); }; return (
{ e.preventDefault(); submit(); }} > {t('general.feedback.blockchainAccountMismatch')} {t('general.info.tryingToSignAndBoundIs')}

{user?.organization?.blockchainAccountAddress?.toLowerCase()}

{t('general.info.andYouAreTrying')}

{activeBlockchainAddress?.toLowerCase()}
); };