Browse Source

new UI update

master
azri 1 month ago
parent
commit
c84a962c97

+ 2
- 2
src/components/Footer/Footer.jsx View File

16
         mt: 15,
16
         mt: 15,
17
         px: {
17
         px: {
18
           xs: 2,
18
           xs: 2,
19
-          md: 12,
20
-          lg: 20
19
+          md: 5,
20
+          lg: 5
21
         }
21
         }
22
       }}
22
       }}
23
     >
23
     >

+ 15
- 9
src/components/Navbar/Navbar.jsx View File

12
 import { styled } from '@mui/material/styles';
12
 import { styled } from '@mui/material/styles';
13
 import { MenuItem, Select, FormControl, Badge, Typography } from '@mui/material';
13
 import { MenuItem, Select, FormControl, Badge, Typography } from '@mui/material';
14
 import MobileNav from "./components/MobileNav";
14
 import MobileNav from "./components/MobileNav";
15
+import SideCart from "../SideCart/SideCart";
15
 import MenuIcon from "@mui/icons-material/Menu";
16
 import MenuIcon from "@mui/icons-material/Menu";
16
 import SearchProduct from "../SearchProduct"
17
 import SearchProduct from "../SearchProduct"
17
 import CategoryIcon from '@mui/icons-material/Category';
18
 import CategoryIcon from '@mui/icons-material/Category';
120
   const products = useSelector((state) => state.products.products.data)
121
   const products = useSelector((state) => state.products.products.data)
121
   const [cartAmount, setCartAmount] = useState(0);
122
   const [cartAmount, setCartAmount] = useState(0);
122
 
123
 
123
-  const [open, setOpen] = useState(false);
124
+  const [openSideMenu, setOpenSideMenu] = useState(false);
125
+  const [openSideCart, setOpenSideCart] = useState(false);
124
   const [navItem, setNavItem] = useState([]);
126
   const [navItem, setNavItem] = useState([]);
125
 
127
 
126
   const [displayCollection, setDisplayCollection] = useState({
128
   const [displayCollection, setDisplayCollection] = useState({
290
         <Toolbar sx={{
292
         <Toolbar sx={{
291
           px: {
293
           px: {
292
             xs: 2,
294
             xs: 2,
293
-            md: 10,
294
-            lg: 20
295
+          md: 5,
296
+          lg: 5
295
           },
297
           },
296
           py: 0.5
298
           py: 0.5
297
         }} disableGutters>
299
         }} disableGutters>
307
             }}>
309
             }}>
308
 
310
 
309
               <IconButton
311
               <IconButton
310
-                onClick={() => setOpen(true)}
312
+                onClick={() => setOpenSideMenu(true)}
311
                 className="navItem"
313
                 className="navItem"
312
                 sx={{
314
                 sx={{
313
                   backgroundColor: "transparent",
315
                   backgroundColor: "transparent",
422
                 </LanguageSelect>
424
                 </LanguageSelect>
423
               </FormControl> */}
425
               </FormControl> */}
424
 
426
 
425
-              <IconButton onClick={()=>{setShowSearch(true)}}>
427
+              <IconButton onClick={() => { setShowSearch(true) }}>
426
                 <SearchIcon className="navItem" style={{
428
                 <SearchIcon className="navItem" style={{
427
                   transition: "all 0.3s ease-in-out",
429
                   transition: "all 0.3s ease-in-out",
428
                   color: (isAtTop) ? "white" : "black",
430
                   color: (isAtTop) ? "white" : "black",
429
                 }} />
431
                 }} />
430
               </IconButton>
432
               </IconButton>
431
 
433
 
432
-              <Badge sx={{ cursor: "pointer" }} onClick={() => { window.location.href = "/cart" }} badgeContent={cartAmount} color="primary">
434
+              <Badge
435
+                sx={{ cursor: "pointer" }}
436
+                onClick={() => { setOpenSideCart(true) }}
437
+                badgeContent={cartAmount} color="primary">
433
                 <LocalMallIcon className="navItem" style={{
438
                 <LocalMallIcon className="navItem" style={{
434
                   transition: "all 0.3s ease-in-out",
439
                   transition: "all 0.3s ease-in-out",
435
                   color: (isAtTop) ? "white" : "black",
440
                   color: (isAtTop) ? "white" : "black",
488
         </Box>
493
         </Box>
489
 
494
 
490
       </AppBar>
495
       </AppBar>
491
-      {showSearch && <SearchProduct onClose={()=>{setShowSearch(false)}}/>}
496
+      {showSearch && <SearchProduct onClose={() => { setShowSearch(false) }} />}
497
+
498
+      <MobileNav open={openSideMenu} menu={navItem} onClose={() => { setOpenSideMenu(false) }} />
499
+      <SideCart open={openSideCart} onClose={()=>{setOpenSideCart(false)}}/>
492
 
500
 
493
-      <MobileNav open={open} menu={navItem} onClose={() => { setOpen(false) }} />
494
-      
495
     </>
501
     </>
496
   );
502
   );
497
 };
503
 };

+ 47
- 40
src/components/ProductSelected/ProductSelected.jsx View File

124
               }}>
124
               }}>
125
                 {`${minPriceCurrency} ${parseFloat(minPrice).toFixed(2)}`}
125
                 {`${minPriceCurrency} ${parseFloat(minPrice).toFixed(2)}`}
126
               </Typography>
126
               </Typography>
127
-              <Typography variant="body2" sx={{ mt: 2 }}>
128
-                {extra_desc}
129
-              </Typography>
130
             </Box>
127
             </Box>
131
           </Box>
128
           </Box>
132
         </a>
129
         </a>
137
 
134
 
138
 
135
 
139
   return (
136
   return (
140
-    <Box sx={{
141
-      mb: 5,
142
-    }}>
137
+    <Box>
143
 
138
 
144
       {/* OFFSET PURPOSE */}
139
       {/* OFFSET PURPOSE */}
145
-      <Grid size={{ xs: 12, md: 4 }} sx={{ mx: "auto", display: "flex", alignItems: "center", justifyContent: "center", my: 4 }}>
140
+      <Grid
141
+        size={{ xs: 12, md: 4 }}
142
+        sx={{
143
+          mx: "auto",
144
+          display: "flex",
145
+          alignItems: "center",
146
+          justifyContent: "center",
147
+          my: 4,
148
+          mb: 0
149
+        }}>
146
         <ChevronLeftIcon
150
         <ChevronLeftIcon
147
           style={{
151
           style={{
148
             cursor: "pointer",
152
             cursor: "pointer",
163
         />
167
         />
164
       </Grid>
168
       </Grid>
165
 
169
 
166
-      <Swiper
167
-        modules={[Scrollbar, A11y]}
168
-        spaceBetween={20}
169
-        breakpoints={{
170
-          0: { slidesPerView: 2 }, // For very small screens
171
-          640: { slidesPerView: 2 }, // For screens >= 640px
172
-          1024: { slidesPerView: 4 }, // For screens >= 1024px
173
-        }}
174
-        pagination={{ clickable: true }}
175
-        scrollbar={{ draggable: true }}
176
-        onSwiper={(swiper) => (swiperRef.current = swiper)}
177
-      >
178
-        {filterProducts.map((product, index) => {
179
-
180
-          let { handle, title, images, collections, minVariantPrice, maxVariantPrice, productType, variants } = product
181
-
182
-          let minPrice = minVariantPrice.amount
183
-          let minPriceCurrency = minVariantPrice.currencyCode
184
-          let maxPrice = maxVariantPrice.amount
185
-          let maxPriceCurrency = maxVariantPrice.currencyCode
186
-
187
-          let img_url = images[0]?.url
188
-          let collection_name = collections[0]?.title
189
-
190
-          return (
191
-            <SwiperSlide>
192
-              {renderProduct(handle, img_url, title, collection_name, minPrice, minPriceCurrency, maxPrice, maxPriceCurrency, "")}
193
-            </SwiperSlide>
194
-          )
195
-
196
-        })}
197
-
198
-      </Swiper>
170
+      <Box sx={{mt:2}}>
171
+        <Swiper
172
+          modules={[Scrollbar, A11y]}
173
+          spaceBetween={10}
174
+          breakpoints={{
175
+            0: { slidesPerView: 2 }, // For very small screens
176
+            640: { slidesPerView: 2 }, // For screens >= 640px
177
+            1024: { slidesPerView: 4 }, // For screens >= 1024px
178
+          }}
179
+          pagination={{ clickable: true }}
180
+          scrollbar={{ draggable: true }}
181
+          onSwiper={(swiper) => (swiperRef.current = swiper)}
182
+        >
183
+          {filterProducts.map((product, index) => {
184
+
185
+            let { handle, title, images, collections, minVariantPrice, maxVariantPrice, productType, variants } = product
186
+
187
+            let minPrice = minVariantPrice.amount
188
+            let minPriceCurrency = minVariantPrice.currencyCode
189
+            let maxPrice = maxVariantPrice.amount
190
+            let maxPriceCurrency = maxVariantPrice.currencyCode
191
+
192
+            let img_url = images[0]?.url
193
+            let collection_name = collections[0]?.title
194
+
195
+            return (
196
+              <SwiperSlide>
197
+                {renderProduct(handle, img_url, title, collection_name, minPrice, minPriceCurrency, maxPrice, maxPriceCurrency, "")}
198
+              </SwiperSlide>
199
+            )
200
+
201
+          })}
202
+
203
+        </Swiper>
204
+      </Box>
205
+
199
     </Box>
206
     </Box>
200
   );
207
   );
201
 };
208
 };

+ 8
- 3
src/components/VideoAds/VideoAds.jsx View File

9
       sx={{
9
       sx={{
10
         position: 'relative',
10
         position: 'relative',
11
         overflow: 'hidden',
11
         overflow: 'hidden',
12
-        width: width || '100%',
13
-        height: height || '300px',
14
-        
12
+        width: '100%',
13
+        height: {
14
+          xs:230,
15
+          sm:330,
16
+          md:520,
17
+          lg:675,
18
+          xl:850
19
+        },
15
       }}
20
       }}
16
     >
21
     >
17
       <video
22
       <video

+ 2
- 2
src/pages/Cart.jsx View File

58
       <Box sx={{
58
       <Box sx={{
59
         px: {
59
         px: {
60
           xs: 2,
60
           xs: 2,
61
-          md: 12,
62
-          lg: 20
61
+          md: 5,
62
+          lg: 5
63
         },
63
         },
64
         mb: {
64
         mb: {
65
           xs: 0,
65
           xs: 0,

+ 2
- 2
src/pages/Checkout.jsx View File

19
     <Box sx={{
19
     <Box sx={{
20
       px: {
20
       px: {
21
         xs: 2,
21
         xs: 2,
22
-        md: 12,
23
-        lg: 20
22
+        md: 5,
23
+        lg: 5
24
       },
24
       },
25
       mb: {
25
       mb: {
26
         xs: 0,
26
         xs: 0,

+ 2
- 2
src/pages/Collection.jsx View File

24
       <Box sx={{
24
       <Box sx={{
25
         px: {
25
         px: {
26
           xs: 2,
26
           xs: 2,
27
-          md: 12,
28
-          lg: 20
27
+          md: 5,
28
+          lg: 5
29
         },
29
         },
30
         mb: {
30
         mb: {
31
           xs: 0,
31
           xs: 0,

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

26
       <Box sx={{
26
       <Box sx={{
27
         px: {
27
         px: {
28
           xs: 2,
28
           xs: 2,
29
-          md: 12,
30
-          lg: 20
31
-        },
32
-        mb: {
33
-          xs: 0,
34
           md: 5,
29
           md: 5,
35
-          lg: 10
30
+          lg: 5
36
         }
31
         }
37
       }}>
32
       }}>
38
 
33
 
40
         
35
         
41
       </Box>
36
       </Box>
42
 
37
 
43
-      <VideoAds width={"100%"} height={{
44
-        xs: 250,
45
-        md: 500,
46
-        lg: 750,
47
-      }} />
38
+      <VideoAds />
48
 
39
 
49
       <Box sx={{
40
       <Box sx={{
50
         px: {
41
         px: {
51
           xs: 2,
42
           xs: 2,
52
-          md: 12,
53
-          lg: 20
43
+          md: 5,
44
+          lg: 5
54
         },
45
         },
55
         mb: {
46
         mb: {
56
           xs: 2,
47
           xs: 2,
78
       <NewsLetter />
69
       <NewsLetter />
79
 
70
 
80
       <Box sx={{ px:{
71
       <Box sx={{ px:{
81
-        xs:2,
82
-        md:12,
83
-        lg:20
72
+        xs: 2,
73
+        md: 5,
74
+        lg: 5
84
       }, mb: 10 }}>
75
       }, mb: 10 }}>
85
 
76
 
86
         <SocialMedia />
77
         <SocialMedia />

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

49
     <Box sx={{
49
     <Box sx={{
50
       px: {
50
       px: {
51
         xs: 2,
51
         xs: 2,
52
-        md: 12,
53
-        lg: 20
52
+        md: 5,
53
+        lg: 5
54
       },
54
       },
55
       mb: {
55
       mb: {
56
         xs: 0,
56
         xs: 0,

Loading…
Cancel
Save