components#MoonpayModal TypeScript Examples

The following examples show how to use components#MoonpayModal. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BuyFiatSection.tsx    From interface-v2 with GNU General Public License v3.0 5 votes vote down vote up
BuyFiatSection: React.FC = () => {
  const classes = useStyles();
  const [openMenu, setOpenMenu] = useState(false);
  const [showMoonPayWidget, setShowMoonPayWidget] = useState(false);

  return (
    <Box className={classes.buyFiatContainer}>
      {showMoonPayWidget && (
        <MoonpayModal
          open={showMoonPayWidget}
          onClose={() => setShowMoonPayWidget(false)}
        />
      )}
      {openMenu && (
        <BuyFiatModal
          open={openMenu}
          onClose={() => setOpenMenu(false)}
          buyMoonpay={() => {
            setShowMoonPayWidget(true);
            setOpenMenu(false);
          }}
        />
      )}
      <img src={FiatMask} alt='Fiat Mask' />
      <Box>
        <Box className='buyFiatInfo'>
          <img src={BuyWithFiat} alt='buy with fiat' />
          <Box>
            <Typography variant='h3'>Buy crypto with Fiat</Typography>
            <Typography variant='h6'>
              Simple way to buy or sell crypto with a credit card, bank transfer
              and more
            </Typography>
          </Box>
        </Box>
        <Box className='buyFiatWrapper'>
          <Button
            fullWidth
            color='primary'
            onClick={() => {
              setOpenMenu(true);
            }}
          >
            Buy Now
          </Button>
        </Box>
      </Box>
    </Box>
  );
}