Bläddra i källkod

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

master
azri 2 veckor sedan
förälder
incheckning
5cc98be14a

+ 1
- 0
src/components/Navbar/Navbar.jsx Visa fil

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

+ 2
- 2
src/components/ProductType/ProductType.jsx Visa fil

@@ -1,7 +1,7 @@
1 1
 import React from 'react';
2 2
 import { Box, Button, Typography } from '@mui/material';
3 3
 
4
-const ProductType = () => {
4
+const ProductType = ({title}) => {
5 5
   return (
6 6
     <Box
7 7
       sx={{
@@ -28,7 +28,7 @@ const ProductType = () => {
28 28
         }}
29 29
       >
30 30
         <Typography variant="h4" gutterBottom>
31
-          Some Type
31
+          {title}
32 32
         </Typography>
33 33
         <Button variant="contained" color="primary">
34 34
           SHOP NOW

+ 5
- 8
src/pages/Home.jsx Visa fil

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

+ 1
- 1
src/pages/Products/Product.jsx Visa fil

@@ -58,7 +58,7 @@ const Product = () => {
58 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 63
         <Grid size={12} sx={{ backgroundColor: "#000", textAlign:"center", display:{xs:"block", md:"none"} }}>
64 64
           <img src={logoSrc} alt="Logo"

Laddar…
Avbryt
Spara