Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ShippingModal.tsx 1000B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { Modal } from '@mui/material';
  2. import { Box } from '@mui/system';
  3. import ContactForm from '../../forms/contact/ContactForm';
  4. import ShippingDetailsForm from '../../forms/shipping-details/ShippingDetailsForm';
  5. const ShippingModal = ({
  6. open,
  7. handleClose,
  8. handleChangeShipping,
  9. handleChangeContact,
  10. }) => {
  11. return (
  12. <Modal
  13. open={open.isOpen}
  14. onClose={handleClose}
  15. aria-labelledby="modal-modal-title"
  16. aria-describedby="modal-modal-description"
  17. >
  18. <Box
  19. sx={{
  20. width: { xs: '90%', md: '50%' },
  21. top: '50%',
  22. left: '50%',
  23. position: 'absolute',
  24. transform: 'translate(-50%, -50%)',
  25. }}
  26. >
  27. {open.type === 'Shipping' && (
  28. <ShippingDetailsForm submitHandler={handleChangeShipping} />
  29. )}
  30. {open.type === 'Contact' && (
  31. <ContactForm submitHandler={handleChangeContact} />
  32. )}
  33. </Box>
  34. </Modal>
  35. );
  36. };
  37. export default ShippingModal;