Просмотр исходного кода

feat module 2 : modified navigation bar (remove menu, rename menu) - website, mobile

master
nadia 1 день назад
Родитель
Сommit
c753a5c048

+ 9
- 1
src/components/Navbar/Navbar.jsx Просмотреть файл

83
 
83
 
84
 const normalizeTitle = (value = "") => value.trim().toUpperCase();
84
 const normalizeTitle = (value = "") => value.trim().toUpperCase();
85
 
85
 
86
+const getProductTypeMenuLabel = (productType = "") => {
87
+  return normalizeTitle(productType) === "BEAUTY" ? "Essentials" : productType;
88
+};
89
+
86
 const sortCollectionsByPriority = (collection = [], productType = "") => {
90
 const sortCollectionsByPriority = (collection = [], productType = "") => {
87
   const typeKey = (productType || "").trim().toLowerCase();
91
   const typeKey = (productType || "").trim().toLowerCase();
88
   const priorityList = COLLECTION_PRIORITY_BY_TYPE[typeKey] || [];
92
   const priorityList = COLLECTION_PRIORITY_BY_TYPE[typeKey] || [];
216
 
220
 
217
       let navItemData = mapProductTypesWithCollections(products)
221
       let navItemData = mapProductTypesWithCollections(products)
218
       navItemData = getUniqueCollections(navItemData)
222
       navItemData = getUniqueCollections(navItemData)
223
+      navItemData = navItemData.filter(({ productType }) => normalizeTitle(productType) !== "HOME")
219
 
224
 
220
       setNavItem(navItemData)
225
       setNavItem(navItemData)
221
 
226
 
222
       // extra info for the navbar
227
       // extra info for the navbar
228
+      setNavItemCompanyInfo([]);
229
+      /*
223
       setNavItemCompanyInfo([{
230
       setNavItemCompanyInfo([{
224
         name:"DELIVERY INFORMATION",
231
         name:"DELIVERY INFORMATION",
225
         link:"/delivery_info"
232
         link:"/delivery_info"
236
         name:"CONTACT US",
243
         name:"CONTACT US",
237
         link:"/contact_us"
244
         link:"/contact_us"
238
       }]);
245
       }]);
246
+      */
239
 
247
 
240
     }
248
     }
241
 
249
 
480
                     ":hover::after": {
488
                     ":hover::after": {
481
                       width: "50%", // Expands on hover
489
                       width: "50%", // Expands on hover
482
                     },
490
                     },
483
-                  }}>{productType}</Typography>
491
+                  }}>{getProductTypeMenuLabel(productType)}</Typography>
484
               </Button>))}
492
               </Button>))}
485
 
493
 
486
               {navItemCompanyInfo.map(({ name, link }) => (<Button
494
               {navItemCompanyInfo.map(({ name, link }) => (<Button

+ 5
- 1
src/components/Navbar/components/MobileNav/MobileNav.jsx Просмотреть файл

5
 import Grid from '@mui/material/Grid2';
5
 import Grid from '@mui/material/Grid2';
6
 import logoSrc from "../../../../assets/images/amberlogo.png";
6
 import logoSrc from "../../../../assets/images/amberlogo.png";
7
 
7
 
8
+const getProductTypeMenuLabel = (productType = "") => {
9
+  return productType.trim().toUpperCase() === "BEAUTY" ? "Essentials" : productType;
10
+};
11
+
8
 const MobileNav = ({ open, onClose, menu = [], infomenu = [] }) => {
12
 const MobileNav = ({ open, onClose, menu = [], infomenu = [] }) => {
9
 
13
 
10
   // React.useEffect(()=>{
14
   // React.useEffect(()=>{
153
                   },
157
                   },
154
                 }}
158
                 }}
155
               >
159
               >
156
-                {productType?.toUpperCase()}
160
+                {getProductTypeMenuLabel(productType)?.toUpperCase()}
157
               </Typography>
161
               </Typography>
158
             </AccordionSummary>
162
             </AccordionSummary>
159
             <AccordionDetails>
163
             <AccordionDetails>

+ 2
- 1
src/pages/Home.jsx Просмотреть файл

76
               <ProductType title={'Apparel'} img_url={AmberClothing}/>
76
               <ProductType title={'Apparel'} img_url={AmberClothing}/>
77
             </Grid>
77
             </Grid>
78
             <Grid size={{xs:12, md:6}}>
78
             <Grid size={{xs:12, md:6}}>
79
-              <ProductType title={'BEAUTY'} img_url={AmberBeautyWallpaper}/>
79
+              {/* <ProductType title={'BEAUTY'} img_url={AmberBeautyWallpaper}/> */}
80
+              <ProductType title={'Essentials'} img_url={AmberBeautyWallpaper}/>
80
             </Grid>
81
             </Grid>
81
             <Grid size={{xs:12, md:6}}>
82
             <Grid size={{xs:12, md:6}}>
82
               <ProductType title={'HOME'} img_url={AmberHomeWallpaper} />
83
               <ProductType title={'HOME'} img_url={AmberHomeWallpaper} />

Загрузка…
Отмена
Сохранить