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.

Feature.jsx 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import React from 'react';
  2. import { Box, Typography } from '@mui/material';
  3. import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn';
  4. import ReplayIcon from '@mui/icons-material/Replay';
  5. import AssuredWorkloadIcon from '@mui/icons-material/AssuredWorkload';
  6. import SupportAgentIcon from '@mui/icons-material/SupportAgent';
  7. const Feature = () => {
  8. const features = [
  9. { icon: <AssignmentTurnedInIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Pickup at any Store', description: "Free shipping on orders over $65" },
  10. { icon: <ReplayIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Free returns', description:"30-days free return policy." },
  11. { icon: <AssuredWorkloadIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Secured payments', description:"We accept all major credit cards." },
  12. { icon: <SupportAgentIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Customer service', description:"Top notch customer service." },
  13. ];
  14. return (
  15. <Box
  16. sx={{
  17. display: 'flex',
  18. flexDirection: { xs: 'column', sm: 'row' }, // Stack on small screens, horizontal on larger screens
  19. justifyContent: 'space-between',
  20. alignItems: 'center',
  21. padding: 2,
  22. mt: 5,
  23. gap: { xs: 4, sm: 0 }, // Add spacing between items on smaller screens
  24. }}
  25. >
  26. {features.map((feature, index) => (
  27. <Box
  28. key={index}
  29. sx={{
  30. display: 'flex',
  31. flexDirection: 'column',
  32. alignItems: 'center',
  33. textAlign: 'center',
  34. flex: 1,
  35. borderRight: { sm: index < features.length - 1 ? '1px solid #CFCFCF' : 'none' }, // Only show right border on larger screens
  36. padding: 2,
  37. }}
  38. >
  39. {feature.icon}
  40. <Typography
  41. variant="body1"
  42. sx={{ marginTop: 1, fontWeight: 'bold', color: 'text.primary' }}
  43. >
  44. {feature.name}
  45. </Typography>
  46. <Typography
  47. variant="body2"
  48. sx={{ marginTop: 1, color: 'text.primary' }}
  49. >
  50. {feature.description}
  51. </Typography>
  52. </Box>
  53. ))}
  54. </Box>
  55. );
  56. };
  57. export default Feature;