Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ProductInfo.jsx 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import { Button, ButtonGroup, Typography } from '@mui/material';
  2. import { Box } from '@mui/system';
  3. import Image from 'next/image';
  4. import PropType from 'prop-types';
  5. const ProductInfo = ({ data, bColor, side }) => {
  6. return (
  7. <Box
  8. sx={{
  9. display: 'flex',
  10. flexDirection: 'column',
  11. width: '50%',
  12. maxWidth: '50%',
  13. height: '100%',
  14. pl: side === 'right' ? '10%' : 0,
  15. }}
  16. >
  17. <Typography variant="h3" sx={{ height: 60, mt: 15, color: 'white' }}>
  18. {data.name}
  19. </Typography>
  20. <Box
  21. sx={{
  22. width: 100,
  23. maxWidth: 100,
  24. height: 60,
  25. }}
  26. >
  27. <Image
  28. src="/images/Stars.svg"
  29. alt="reviews"
  30. width={100}
  31. height={50}
  32. ></Image>
  33. </Box>
  34. <Typography
  35. sx={{
  36. pr: '20%',
  37. color: 'white',
  38. }}
  39. >
  40. {data.description}
  41. </Typography>
  42. <Box
  43. sx={{
  44. width: '100%',
  45. display: 'flex',
  46. mt: 4,
  47. }}
  48. >
  49. <ButtonGroup
  50. size="small"
  51. aria-label="small outlined button group"
  52. sx={{
  53. height: 50,
  54. mr: 3,
  55. backgroundColor: bColor === 'light' ? '#664c47' : '#8f7772',
  56. color: 'white',
  57. border: 0,
  58. }}
  59. >
  60. <Button
  61. sx={{
  62. color: 'white',
  63. fontSize: 20,
  64. width: 50,
  65. }}
  66. onClick={() => {}}
  67. >
  68. -
  69. </Button>
  70. <Button
  71. sx={{
  72. color: 'white',
  73. fontSize: 17,
  74. width: 50,
  75. }}
  76. >
  77. 1
  78. </Button>
  79. <Button
  80. sx={{
  81. color: 'white',
  82. fontSize: 20,
  83. width: 50,
  84. }}
  85. onClick={() => {}}
  86. >
  87. +
  88. </Button>
  89. </ButtonGroup>
  90. <Button
  91. sx={{
  92. backgroundColor: '#CBA213',
  93. height: 50,
  94. width: 150,
  95. color: 'white',
  96. }}
  97. >
  98. Add to cart
  99. </Button>
  100. </Box>
  101. </Box>
  102. );
  103. };
  104. ProductInfo.propTypes = {
  105. data: PropType.shape({
  106. name: PropType.string,
  107. description: PropType.string,
  108. }),
  109. bColor: PropType.string,
  110. side: PropType.string,
  111. };
  112. export default ProductInfo;