Browse Source

temp feature home

master
azri 1 month ago
parent
commit
5a0c054832

BIN
src/assets/images/amberBeautyWallpaper.jpg View File


BIN
src/assets/images/amberClothing.jpg View File


+ 6
- 3
src/components/ProductType/ProductType.jsx View File

1
 import React from 'react';
1
 import React from 'react';
2
 import { Box, Button, Typography } from '@mui/material';
2
 import { Box, Button, Typography } from '@mui/material';
3
 
3
 
4
-const ProductType = ({title}) => {
4
+const ProductType = ({title, link, img_url}) => {
5
   return (
5
   return (
6
     <Box
6
     <Box
7
       sx={{
7
       sx={{
9
         width: '100%',
9
         width: '100%',
10
         height: 0,
10
         height: 0,
11
         paddingTop: '600px', // This sets the height based on top padding
11
         paddingTop: '600px', // This sets the height based on top padding
12
+        backgroundImage: `url(${img_url})`,
12
         overflow: 'hidden',
13
         overflow: 'hidden',
14
+        backgroundSize:'cover',
15
+        backgroundPosition: 'center center'
13
       }}
16
       }}
14
     >
17
     >
15
       <Box
18
       <Box
27
           color: '#fff', // Text and button color for visibility
30
           color: '#fff', // Text and button color for visibility
28
         }}
31
         }}
29
       >
32
       >
30
-        <Typography variant="h4" gutterBottom>
33
+        <Typography variant="h5" gutterBottom sx={{fontWeight:"600", letterSpacing:7}}>
31
           {title}
34
           {title}
32
         </Typography>
35
         </Typography>
33
-        <Button variant="contained" color="primary">
36
+        <Button variant="contained" color="primary" onClick={()=>{ window.location.href = link }}>
34
           SHOP NOW
37
           SHOP NOW
35
         </Button>
38
         </Button>
36
       </Box>
39
       </Box>

+ 7
- 3
src/pages/Home.jsx View File

14
 
14
 
15
 import ProductService from "../services/ProductService"
15
 import ProductService from "../services/ProductService"
16
 
16
 
17
+import AmberHomeWallpaper from "../assets/images/titleBg.jpg";
18
+import AmberBeautyWallpaper from "../assets/images/amberBeautyWallpaper.jpg";
19
+import AmberClothing from "../assets/images/amberClothing.jpg"
20
+
17
 const Home = () => {
21
 const Home = () => {
18
 
22
 
19
   React.useEffect(()=>{
23
   React.useEffect(()=>{
84
         <Box sx={{ flexGrow: 1, mt: 10 }}>
88
         <Box sx={{ flexGrow: 1, mt: 10 }}>
85
           <Grid container spacing={2}>
89
           <Grid container spacing={2}>
86
             <Grid size={12}>
90
             <Grid size={12}>
87
-              <ProductType title={'CLOTHING'}/>
91
+              <ProductType title={'CLOTHING'} link={'/collection/clothing'} img_url={AmberClothing}/>
88
             </Grid>
92
             </Grid>
89
             <Grid size={{xs:12, md:6}}>
93
             <Grid size={{xs:12, md:6}}>
90
-              <ProductType title={'BEAUTY'}/>
94
+              <ProductType title={'BEAUTY'} link={'/collection/beauty'} img_url={AmberBeautyWallpaper}/>
91
             </Grid>
95
             </Grid>
92
             <Grid size={{xs:12, md:6}}>
96
             <Grid size={{xs:12, md:6}}>
93
-              <ProductType title={'HOME'}/>
97
+              <ProductType title={'HOME'} link={'/collection/home'} img_url={AmberHomeWallpaper} />
94
             </Grid>
98
             </Grid>
95
           </Grid>
99
           </Grid>
96
         </Box>
100
         </Box>

Loading…
Cancel
Save