You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ShippingData.jsx 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { Button, Typography } from '@mui/material';
  2. import { Box } from '@mui/system';
  3. import { useTranslation } from 'next-i18next';
  4. import PropType from 'prop-types';
  5. const ShippingData = ({ email, address, city, postcode, handleOpen }) => {
  6. const { t } = useTranslation('shipping');
  7. return (
  8. <>
  9. <Box
  10. sx={{
  11. display: 'flex',
  12. justifyContent: 'space-between',
  13. backgroundColor: '#f2f2f2',
  14. alignItems: 'center',
  15. mb: 2,
  16. borderRadius: 2,
  17. p: 1,
  18. }}
  19. >
  20. <Typography sx={{ fontSize: 18, fontWeight: 600 }}>
  21. {t('shipping:contact')}
  22. </Typography>
  23. <Typography>{email}</Typography>
  24. <Button
  25. sx={{
  26. height: 35,
  27. minWidth: { md: 125, xs: 90 },
  28. fontSize: 15,
  29. textTransform: 'none',
  30. backgroundColor: '#CBA213',
  31. color: 'white',
  32. }}
  33. onClick={() => {
  34. handleOpen('Contact');
  35. }}
  36. >
  37. {t('shipping:changeBtn')}
  38. </Button>
  39. </Box>
  40. <Box
  41. sx={{
  42. display: 'flex',
  43. justifyContent: 'space-between',
  44. backgroundColor: '#f2f2f2',
  45. alignItems: 'center',
  46. mb: 2,
  47. borderRadius: 2,
  48. p: 1,
  49. }}
  50. >
  51. <Typography
  52. sx={{
  53. fontSize: { md: 18, xs: 16 },
  54. fontWeight: 600,
  55. mr: { xs: 1, sm: 0 },
  56. }}
  57. >
  58. {t('shipping:shipping')}
  59. </Typography>
  60. <Typography>
  61. {address} | {city} | {postcode}
  62. </Typography>
  63. <Button
  64. sx={{
  65. height: 35,
  66. minWidth: { md: 125, xs: 90 },
  67. fontSize: 15,
  68. textTransform: 'none',
  69. backgroundColor: '#CBA213',
  70. color: 'white',
  71. }}
  72. onClick={() => {
  73. handleOpen('Shipping');
  74. }}
  75. >
  76. {t('shipping:changeBtn')}
  77. </Button>
  78. </Box>
  79. </>
  80. );
  81. };
  82. ShippingData.propTypes = {
  83. email: PropType.string,
  84. address: PropType.string,
  85. city: PropType.string,
  86. postcode: PropType.string,
  87. handleOpen: PropType.func,
  88. };
  89. export default ShippingData;