Ver código fonte

new UI update

master
azri 1 mês atrás
pai
commit
c84a962c97

+ 2
- 2
src/components/Footer/Footer.jsx Ver arquivo

@@ -16,8 +16,8 @@ const Footer = () => {
16 16
         mt: 15,
17 17
         px: {
18 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 Ver arquivo

@@ -12,6 +12,7 @@ import logoSrc from "../../assets/images/amberlogo.png";
12 12
 import { styled } from '@mui/material/styles';
13 13
 import { MenuItem, Select, FormControl, Badge, Typography } from '@mui/material';
14 14
 import MobileNav from "./components/MobileNav";
15
+import SideCart from "../SideCart/SideCart";
15 16
 import MenuIcon from "@mui/icons-material/Menu";
16 17
 import SearchProduct from "../SearchProduct"
17 18
 import CategoryIcon from '@mui/icons-material/Category';
@@ -120,7 +121,8 @@ const Navbar = () => {
120 121
   const products = useSelector((state) => state.products.products.data)
121 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 126
   const [navItem, setNavItem] = useState([]);
125 127
 
126 128
   const [displayCollection, setDisplayCollection] = useState({
@@ -290,8 +292,8 @@ const Navbar = () => {
290 292
         <Toolbar sx={{
291 293
           px: {
292 294
             xs: 2,
293
-            md: 10,
294
-            lg: 20
295
+          md: 5,
296
+          lg: 5
295 297
           },
296 298
           py: 0.5
297 299
         }} disableGutters>
@@ -307,7 +309,7 @@ const Navbar = () => {
307 309
             }}>
308 310
 
309 311
               <IconButton
310
-                onClick={() => setOpen(true)}
312
+                onClick={() => setOpenSideMenu(true)}
311 313
                 className="navItem"
312 314
                 sx={{
313 315
                   backgroundColor: "transparent",
@@ -422,14 +424,17 @@ const Navbar = () => {
422 424
                 </LanguageSelect>
423 425
               </FormControl> */}
424 426
 
425
-              <IconButton onClick={()=>{setShowSearch(true)}}>
427
+              <IconButton onClick={() => { setShowSearch(true) }}>
426 428
                 <SearchIcon className="navItem" style={{
427 429
                   transition: "all 0.3s ease-in-out",
428 430
                   color: (isAtTop) ? "white" : "black",
429 431
                 }} />
430 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 438
                 <LocalMallIcon className="navItem" style={{
434 439
                   transition: "all 0.3s ease-in-out",
435 440
                   color: (isAtTop) ? "white" : "black",
@@ -488,10 +493,11 @@ const Navbar = () => {
488 493
         </Box>
489 494
 
490 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 Ver arquivo

@@ -124,9 +124,6 @@ const ProductSelected = () => {
124 124
               }}>
125 125
                 {`${minPriceCurrency} ${parseFloat(minPrice).toFixed(2)}`}
126 126
               </Typography>
127
-              <Typography variant="body2" sx={{ mt: 2 }}>
128
-                {extra_desc}
129
-              </Typography>
130 127
             </Box>
131 128
           </Box>
132 129
         </a>
@@ -137,12 +134,19 @@ const ProductSelected = () => {
137 134
 
138 135
 
139 136
   return (
140
-    <Box sx={{
141
-      mb: 5,
142
-    }}>
137
+    <Box>
143 138
 
144 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 150
         <ChevronLeftIcon
147 151
           style={{
148 152
             cursor: "pointer",
@@ -163,39 +167,42 @@ const ProductSelected = () => {
163 167
         />
164 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 206
     </Box>
200 207
   );
201 208
 };

+ 8
- 3
src/components/VideoAds/VideoAds.jsx Ver arquivo

@@ -9,9 +9,14 @@ const VideoAds = ({ video_url, height, width }) => {
9 9
       sx={{
10 10
         position: 'relative',
11 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 22
       <video

+ 2
- 2
src/pages/Cart.jsx Ver arquivo

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

+ 2
- 2
src/pages/Checkout.jsx Ver arquivo

@@ -19,8 +19,8 @@ const Checkout = () => {
19 19
     <Box sx={{
20 20
       px: {
21 21
         xs: 2,
22
-        md: 12,
23
-        lg: 20
22
+        md: 5,
23
+        lg: 5
24 24
       },
25 25
       mb: {
26 26
         xs: 0,

+ 2
- 2
src/pages/Collection.jsx Ver arquivo

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

+ 7
- 16
src/pages/Home.jsx Ver arquivo

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

+ 2
- 2
src/pages/Products/Product.jsx Ver arquivo

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

Carregando…
Cancelar
Salvar