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.tsx 2.2KB

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