您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ShippingData.jsx 2.2KB

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