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.

FeaturedProduct.jsx 920B

123456789101112131415161718192021222324252627282930313233343536
  1. import { Box } from '@mui/system';
  2. import PropType from 'prop-types';
  3. import ProductImage from './ProductImage';
  4. import ProductInfo from './ProductInfo';
  5. const FeaturedProduct = ({ bColor, image, side }) => {
  6. return (
  7. <Box
  8. sx={{
  9. width: '100%',
  10. maxHeight: 500,
  11. height: 500,
  12. backgroundColor: bColor === 'dark' ? 'primary.main' : 'primary.light',
  13. display: 'flex',
  14. }}
  15. >
  16. {side === 'left' ? (
  17. <ProductImage image={image}></ProductImage>
  18. ) : (
  19. <ProductInfo bColor={bColor} side={side}></ProductInfo>
  20. )}
  21. {side === 'left' ? (
  22. <ProductInfo bColor={bColor} side={side}></ProductInfo>
  23. ) : (
  24. <ProductImage image={image}></ProductImage>
  25. )}
  26. </Box>
  27. );
  28. };
  29. FeaturedProduct.propTypes = {
  30. bColor: PropType.string,
  31. image: PropType.string,
  32. side: PropType.string,
  33. };
  34. export default FeaturedProduct;