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 899B

1234567891011121314151617181920212223242526272829303132333435
  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. minHeight: 500,
  11. backgroundColor: bColor === 'dark' ? 'primary.main' : 'primary.light',
  12. display: 'flex',
  13. }}
  14. >
  15. {side === 'left' ? (
  16. <ProductImage image={image}></ProductImage>
  17. ) : (
  18. <ProductInfo bColor={bColor} side={side}></ProductInfo>
  19. )}
  20. {side === 'left' ? (
  21. <ProductInfo bColor={bColor} side={side}></ProductInfo>
  22. ) : (
  23. <ProductImage image={image}></ProductImage>
  24. )}
  25. </Box>
  26. );
  27. };
  28. FeaturedProduct.propTypes = {
  29. bColor: PropType.string,
  30. image: PropType.string,
  31. side: PropType.string,
  32. };
  33. export default FeaturedProduct;