1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js
Alex Donesky f087e501a1
Add modal with directions to re-add token as NFT (#13291)
* Add modal pop for NFTs previously added as tokens - with directions to re-add as NFTs
2022-01-19 12:42:41 -06:00

47 lines
1.3 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { useHistory } from 'react-router-dom';
import Modal from '../../modal';
import Typography from '../../../ui/typography';
import { TYPOGRAPHY } from '../../../../helpers/constants/design-system';
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import { ADD_COLLECTIBLE_ROUTE } from '../../../../helpers/constants/routes';
const ConvertTokenToNFTModal = ({ hideModal, tokenAddress }) => {
const history = useHistory();
const t = useI18nContext();
return (
<Modal
onSubmit={() => {
history.push({
pathname: ADD_COLLECTIBLE_ROUTE,
state: { tokenAddress },
});
hideModal();
}}
submitText={t('yes')}
onCancel={() => hideModal()}
cancelText={t('cancel')}
>
<div className="convert-token-to-nft-modal">
<Typography
variant={TYPOGRAPHY.H6}
boxProps={{
marginTop: 2,
}}
>
{t('convertTokenToNFTDescription')}
</Typography>
</div>
</Modal>
);
};
ConvertTokenToNFTModal.propTypes = {
hideModal: PropTypes.func.isRequired,
tokenAddress: PropTypes.string,
};
export default withModalProps(ConvertTokenToNFTModal);