Browse Source

fix bug on navbar, and add top padding on product details

master
azri 2 weeks ago
parent
commit
5cc98be14a

+ 1
- 0
src/components/Navbar/Navbar.jsx View File

79
       if (Array.isArray(data)) {
79
       if (Array.isArray(data)) {
80
 
80
 
81
         let navItemData = data.map(({node})=>({title:`${node.toUpperCase()}`, link:`/collection/${node}` }))
81
         let navItemData = data.map(({node})=>({title:`${node.toUpperCase()}`, link:`/collection/${node}` }))
82
+        navItemData = navItemData.filter(({title}) => (title !== "") )
82
         setNavItem(navItemData);
83
         setNavItem(navItemData);
83
 
84
 
84
       } else {
85
       } else {

+ 2
- 2
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 = () => {
4
+const ProductType = ({title}) => {
5
   return (
5
   return (
6
     <Box
6
     <Box
7
       sx={{
7
       sx={{
28
         }}
28
         }}
29
       >
29
       >
30
         <Typography variant="h4" gutterBottom>
30
         <Typography variant="h4" gutterBottom>
31
-          Some Type
31
+          {title}
32
         </Typography>
32
         </Typography>
33
         <Button variant="contained" color="primary">
33
         <Button variant="contained" color="primary">
34
           SHOP NOW
34
           SHOP NOW

+ 5
- 8
src/pages/Home.jsx View File

68
         lg: 750,
68
         lg: 750,
69
       }} />
69
       }} />
70
 
70
 
71
-      {/* <Box sx={{
71
+      <Box sx={{
72
         px: {
72
         px: {
73
           xs: 2,
73
           xs: 2,
74
           md: 12,
74
           md: 12,
84
         <Box sx={{ flexGrow: 1, mt: 10 }}>
84
         <Box sx={{ flexGrow: 1, mt: 10 }}>
85
           <Grid container spacing={2}>
85
           <Grid container spacing={2}>
86
             <Grid size={12}>
86
             <Grid size={12}>
87
-              <ProductType />
87
+              <ProductType title={'CLOTHING'}/>
88
             </Grid>
88
             </Grid>
89
             <Grid size={{xs:12, md:6}}>
89
             <Grid size={{xs:12, md:6}}>
90
-              <ProductType />
90
+              <ProductType title={'BEAUTY'}/>
91
             </Grid>
91
             </Grid>
92
             <Grid size={{xs:12, md:6}}>
92
             <Grid size={{xs:12, md:6}}>
93
-              <ProductType />
94
-            </Grid>
95
-            <Grid size={12}>
96
-              <ProductType />
93
+              <ProductType title={'HOME'}/>
97
             </Grid>
94
             </Grid>
98
           </Grid>
95
           </Grid>
99
         </Box>
96
         </Box>
100
 
97
 
101
-      </Box> */}
98
+      </Box>
102
 
99
 
103
       <NewsLetter />
100
       <NewsLetter />
104
 
101
 

+ 1
- 1
src/pages/Products/Product.jsx View File

58
         lg: 10
58
         lg: 10
59
       }
59
       }
60
     }}>
60
     }}>
61
-      <Grid container spacing={0} sx={{ mt: 10, mb:5 }}>
61
+      <Grid container spacing={0} sx={{ mt: 15, mb:5 }}>
62
 
62
 
63
         <Grid size={12} sx={{ backgroundColor: "#000", textAlign:"center", display:{xs:"block", md:"none"} }}>
63
         <Grid size={12} sx={{ backgroundColor: "#000", textAlign:"center", display:{xs:"block", md:"none"} }}>
64
           <img src={logoSrc} alt="Logo"
64
           <img src={logoSrc} alt="Logo"

Loading…
Cancel
Save