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.

ShippingContent.jsx 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. import {
  2. Breadcrumbs,
  3. Button,
  4. Checkbox,
  5. Divider,
  6. FormControlLabel,
  7. Grid,
  8. Typography,
  9. } from '@mui/material';
  10. import { Box } from '@mui/system';
  11. import { useCheckoutData } from '../../store/checkout-context';
  12. import DataCard from '../cards/data-card/DataCard';
  13. const ShippingContent = () => {
  14. const { checkoutStorage } = useCheckoutData();
  15. return (
  16. <Grid container spacing={2} sx={{ py: 10, height: '100%', width: '100%' }}>
  17. <Grid item xs={12}>
  18. <Typography
  19. variant="h3"
  20. sx={{ pl: 12, mt: 12, height: '100%', color: 'primary.main' }}
  21. >
  22. Shipping
  23. </Typography>
  24. </Grid>
  25. <Grid item xs={12}>
  26. <Divider sx={{ backgroundColor: 'primary.main', mx: 12 }} />
  27. </Grid>
  28. <Grid item xs={12} sx={{ mt: 4 }}>
  29. <Breadcrumbs
  30. aria-label="breadcrumb"
  31. separator="›"
  32. sx={{ pl: 12, fontSize: 20 }}
  33. >
  34. <Typography>Cart</Typography>
  35. <Typography>Checkout</Typography>
  36. <Typography color="red">Shipping</Typography>
  37. </Breadcrumbs>
  38. </Grid>
  39. <Grid item xs={12} sx={{ mt: 1 }}>
  40. <Typography sx={{ pl: 12, fontSize: 20 }}>
  41. The following fields will be used as the shipping details for your
  42. order
  43. </Typography>
  44. </Grid>
  45. <Grid item xs={8}>
  46. <Box
  47. sx={{
  48. display: 'flex',
  49. justifyContent: 'space-between',
  50. backgroundColor: '#f2f2f2',
  51. alignItems: 'center',
  52. mt: 2,
  53. ml: 12,
  54. mb: 2,
  55. width: '90%',
  56. borderRadius: 2,
  57. p: 1,
  58. }}
  59. >
  60. <Typography sx={{ fontSize: 18, fontWeight: 600 }}>
  61. Contact
  62. </Typography>
  63. <Typography>{checkoutStorage?.userInfo.email}</Typography>
  64. <Button
  65. sx={{
  66. height: 35,
  67. width: 125,
  68. fontSize: 15,
  69. textTransform: 'none',
  70. backgroundColor: '#CBA213',
  71. color: 'white',
  72. }}
  73. >
  74. Change
  75. </Button>
  76. </Box>
  77. <Box
  78. sx={{
  79. display: 'flex',
  80. justifyContent: 'space-between',
  81. backgroundColor: '#f2f2f2',
  82. alignItems: 'center',
  83. ml: 12,
  84. mb: 2,
  85. width: '90%',
  86. borderRadius: 2,
  87. p: 1,
  88. }}
  89. >
  90. <Typography sx={{ fontSize: 18, fontWeight: 600 }}>
  91. Shipping to
  92. </Typography>
  93. <Typography>
  94. {checkoutStorage?.userInfo.address} |{' '}
  95. {checkoutStorage?.userInfo.city}{' '}
  96. {checkoutStorage?.userInfo.postcode}
  97. </Typography>
  98. <Button
  99. sx={{
  100. height: 35,
  101. width: 125,
  102. fontSize: 15,
  103. textTransform: 'none',
  104. backgroundColor: '#CBA213',
  105. color: 'white',
  106. }}
  107. >
  108. Change
  109. </Button>
  110. </Box>
  111. <Box
  112. sx={{
  113. display: 'flex',
  114. justifyContent: 'space-between',
  115. backgroundColor: '#f2f2f2',
  116. alignItems: 'center',
  117. ml: 12,
  118. mb: 2,
  119. width: '30%',
  120. borderRadius: 2,
  121. p: 1,
  122. }}
  123. >
  124. <FormControlLabel
  125. control={<Checkbox checked disabled />}
  126. label="Free Shipping"
  127. sx={{ color: 'black', ml: 2 }}
  128. />
  129. </Box>
  130. <Box
  131. sx={{
  132. display: 'flex',
  133. ml: 12,
  134. mb: 2,
  135. borderRadius: 2,
  136. p: 1,
  137. }}
  138. >
  139. <Button
  140. variant="contained"
  141. sx={{
  142. mt: 3,
  143. mb: 2,
  144. height: 50,
  145. width: 150,
  146. textTransform: 'none',
  147. backgroundColor: 'primary.main',
  148. color: 'white',
  149. mr: 2,
  150. }}
  151. >
  152. Back to cart
  153. </Button>
  154. <Button
  155. type="submit"
  156. variant="contained"
  157. sx={{
  158. mt: 3,
  159. mb: 2,
  160. backgroundColor: '#CBA213',
  161. height: 50,
  162. width: 200,
  163. textTransform: 'none',
  164. color: 'white',
  165. }}
  166. >
  167. Continue to payment
  168. </Button>
  169. </Box>
  170. </Grid>
  171. <Grid item xs={4}>
  172. <Box sx={{ width: '80%', mt: 2 }}>
  173. {checkoutStorage?.products.map((entry, i) => {
  174. return (
  175. <DataCard
  176. key={i}
  177. data={entry.product}
  178. quantity={entry.quantity}
  179. ></DataCard>
  180. );
  181. })}
  182. </Box>
  183. </Grid>
  184. </Grid>
  185. );
  186. };
  187. export default ShippingContent;