|
@@ -291,142 +291,137 @@ const Navbar = () => {
|
291
|
291
|
py: 0.5
|
292
|
292
|
}} disableGutters>
|
293
|
293
|
|
294
|
|
- {/* Left Section: Logo */}
|
295
|
|
- <Box sx={{
|
296
|
|
- mr: 5,
|
297
|
|
- display: {
|
298
|
|
- xs: "none",
|
299
|
|
- md: "none",
|
300
|
|
- lg: "block",
|
301
|
|
- }
|
302
|
|
- }}>
|
303
|
|
- <a href="/">
|
304
|
|
- <img src={logoSrc} alt="Logo"
|
305
|
|
- style={{
|
306
|
|
- width: 150,
|
307
|
|
- height: 25,
|
308
|
|
- }} />
|
309
|
|
- </a>
|
310
|
|
- </Box>
|
311
|
|
-
|
312
|
|
- {/* SIDEBAR BUTTON */}
|
313
|
|
- <Box sx={{
|
314
|
|
- display: {
|
315
|
|
- xs: "block",
|
316
|
|
- md: "block",
|
317
|
|
- lg: "none"
|
318
|
|
- }
|
319
|
|
- }}>
|
320
|
|
-
|
321
|
|
- <IconButton
|
322
|
|
- onClick={() => setOpen(true)}
|
323
|
|
- className="navItem"
|
324
|
|
- sx={{
|
325
|
|
- backgroundColor: "transparent",
|
326
|
|
- color: (isAtTop) ? "white" : "black",
|
327
|
|
- "&:hover": {
|
328
|
|
- backgroundColor: "rgba(0, 0, 0, 0.1)",
|
329
|
|
- },
|
330
|
|
- }}
|
331
|
|
- >
|
332
|
|
- <MenuIcon fontSize="large" />
|
333
|
|
- </IconButton>
|
334
|
|
-
|
335
|
|
- </Box>
|
336
|
|
-
|
337
|
|
- {/* Center Section: Nav Items */}
|
338
|
|
- <Box
|
339
|
|
- sx={{
|
340
|
|
- flexGrow: 1,
|
|
294
|
+ <Box sx={{ display: "flex", alignItems: "center", width:"100%", position:"relative" }}>
|
|
295
|
+ {/* SIDEBAR BUTTON */}
|
|
296
|
+ <Box sx={{
|
341
|
297
|
display: {
|
342
|
|
- xs: "none",
|
343
|
|
- md: "none",
|
344
|
|
- lg: "flex"
|
345
|
|
- },
|
346
|
|
- gap: 2
|
347
|
|
- }}
|
348
|
|
- >
|
349
|
|
-
|
350
|
|
- {navItem.map(({ productType, collection }) => (<Button
|
351
|
|
- sx={{
|
352
|
|
- position: "relative",
|
353
|
|
- ':hover': {
|
354
|
|
- backgroundColor: "rgba(0,0,0,0)",
|
355
|
|
- }
|
356
|
|
- }}
|
357
|
|
- color="inherit"
|
358
|
|
- onClick={() => {
|
359
|
|
- sessionStorage.setItem('amber-select-product-type', productType)
|
360
|
|
- sessionStorage.removeItem('amber-select-collection')
|
361
|
|
- window.location.href = `/products`;
|
362
|
|
- }}
|
363
|
|
- onMouseEnter={() => {
|
364
|
|
- displayCollectionList(collection, productType)
|
365
|
|
- }}
|
366
|
|
- >
|
367
|
|
- <Typography variant="body2"
|
|
298
|
+ xs: "block",
|
|
299
|
+ md: "block",
|
|
300
|
+ lg: "none"
|
|
301
|
+ }
|
|
302
|
+ }}>
|
|
303
|
+
|
|
304
|
+ <IconButton
|
|
305
|
+ onClick={() => setOpen(true)}
|
368
|
306
|
className="navItem"
|
369
|
307
|
sx={{
|
370
|
|
- fontWeight: "400",
|
|
308
|
+ backgroundColor: "transparent",
|
371
|
309
|
color: (isAtTop) ? "white" : "black",
|
372
|
|
- transition: "all 0.3s ease-in-out",
|
373
|
|
- ":hover": {
|
374
|
|
- color: "#95AAC5 !important"
|
375
|
|
- }
|
376
|
|
- }}>{productType}</Typography>
|
377
|
|
- </Button>))}
|
378
|
|
-
|
379
|
|
- </Box>
|
380
|
|
-
|
381
|
|
- {/* Right Section: Search and Profile */}
|
382
|
|
- <Box sx={{ display: "flex", alignItems: "center", gap: 1.2, ml: "auto" }}>
|
383
|
|
-
|
384
|
|
- {/* <FormControl
|
|
310
|
+ "&:hover": {
|
|
311
|
+ backgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
312
|
+ },
|
|
313
|
+ }}
|
|
314
|
+ >
|
|
315
|
+ <MenuIcon fontSize="large" />
|
|
316
|
+ </IconButton>
|
|
317
|
+
|
|
318
|
+ </Box>
|
|
319
|
+
|
|
320
|
+ {/* Left Section: Logo */}
|
|
321
|
+ <Box sx={{
|
|
322
|
+ mx: "auto",
|
|
323
|
+ }}>
|
|
324
|
+ <a href="/">
|
|
325
|
+ <img src={logoSrc} alt="Logo"
|
|
326
|
+ style={{
|
|
327
|
+ width: 150,
|
|
328
|
+ height: 25,
|
|
329
|
+ }} />
|
|
330
|
+ </a>
|
|
331
|
+ </Box>
|
|
332
|
+
|
|
333
|
+ {/* Center Section: Nav Items */}
|
|
334
|
+ <Box
|
385
|
335
|
sx={{
|
|
336
|
+ flexGrow: 1,
|
386
|
337
|
display: {
|
387
|
338
|
xs: "none",
|
388
|
|
- lg: "block"
|
389
|
|
- }
|
|
339
|
+ md: "none",
|
|
340
|
+ lg: "flex"
|
|
341
|
+ },
|
|
342
|
+ gap: 2
|
390
|
343
|
}}
|
391
|
344
|
>
|
392
|
|
- <LanguageSelect
|
393
|
|
- value={language}
|
394
|
|
- onChange={handleChange}
|
395
|
|
- label=""
|
396
|
|
- MenuProps={{
|
397
|
|
- PaperProps: {
|
398
|
|
- style: {
|
399
|
|
- backgroundColor: 'black',
|
400
|
|
- color: 'white'
|
401
|
|
- },
|
402
|
|
- },
|
|
345
|
+
|
|
346
|
+ {navItem.map(({ productType, collection }) => (<Button
|
|
347
|
+ sx={{
|
|
348
|
+ position: "relative",
|
|
349
|
+ ':hover': {
|
|
350
|
+ backgroundColor: "rgba(0,0,0,0)",
|
|
351
|
+ }
|
|
352
|
+ }}
|
|
353
|
+ color="inherit"
|
|
354
|
+ onClick={() => {
|
|
355
|
+ sessionStorage.setItem('amber-select-product-type', productType)
|
|
356
|
+ sessionStorage.removeItem('amber-select-collection')
|
|
357
|
+ window.location.href = `/products`;
|
|
358
|
+ }}
|
|
359
|
+ onMouseEnter={() => {
|
|
360
|
+ displayCollectionList(collection, productType)
|
403
|
361
|
}}
|
404
|
362
|
>
|
405
|
|
- <LanguageSelectItem value="English">English</LanguageSelectItem>
|
406
|
|
- <LanguageSelectItem value="Malay">Malay</LanguageSelectItem>
|
407
|
|
- <LanguageSelectItem value="Chinese">Chinese</LanguageSelectItem>
|
408
|
|
- </LanguageSelect>
|
409
|
|
- </FormControl> */}
|
410
|
|
-
|
411
|
|
- <IconButton>
|
412
|
|
- <SearchIcon className="navItem" style={{
|
413
|
|
- transition: "all 0.3s ease-in-out",
|
414
|
|
- color: (isAtTop) ? "white" : "black",
|
415
|
|
- }} />
|
416
|
|
- </IconButton>
|
417
|
|
-
|
418
|
|
- <Badge sx={{ cursor: "pointer" }} onClick={() => { window.location.href = "/cart" }} badgeContent={cartAmount} color="primary">
|
419
|
|
- <LocalMallIcon className="navItem" style={{
|
420
|
|
- transition: "all 0.3s ease-in-out",
|
421
|
|
- color: (isAtTop) ? "white" : "black",
|
422
|
|
- }} />
|
423
|
|
- </Badge>
|
424
|
|
-
|
425
|
|
- {/* <IconButton color="inherit">
|
426
|
|
- <AccountCircleIcon sx={{ color: "white" }} />
|
427
|
|
- </IconButton> */}
|
428
|
|
- </Box>
|
|
363
|
+ <Typography variant="body2"
|
|
364
|
+ className="navItem"
|
|
365
|
+ sx={{
|
|
366
|
+ fontWeight: "400",
|
|
367
|
+ color: (isAtTop) ? "white" : "black",
|
|
368
|
+ transition: "all 0.3s ease-in-out",
|
|
369
|
+ ":hover": {
|
|
370
|
+ color: "#95AAC5 !important"
|
|
371
|
+ }
|
|
372
|
+ }}>{productType}</Typography>
|
|
373
|
+ </Button>))}
|
|
374
|
+
|
|
375
|
+ </Box>
|
|
376
|
+
|
|
377
|
+ {/* Right Section: Search and Profile */}
|
|
378
|
+ <Box sx={{ display: "flex", alignItems: "center", gap: 1.2 }}>
|
|
379
|
+
|
|
380
|
+ {/* <FormControl
|
|
381
|
+ sx={{
|
|
382
|
+ display: {
|
|
383
|
+ xs: "none",
|
|
384
|
+ lg: "block"
|
|
385
|
+ }
|
|
386
|
+ }}
|
|
387
|
+ >
|
|
388
|
+ <LanguageSelect
|
|
389
|
+ value={language}
|
|
390
|
+ onChange={handleChange}
|
|
391
|
+ label=""
|
|
392
|
+ MenuProps={{
|
|
393
|
+ PaperProps: {
|
|
394
|
+ style: {
|
|
395
|
+ backgroundColor: 'black',
|
|
396
|
+ color: 'white'
|
|
397
|
+ },
|
|
398
|
+ },
|
|
399
|
+ }}
|
|
400
|
+ >
|
|
401
|
+ <LanguageSelectItem value="English">English</LanguageSelectItem>
|
|
402
|
+ <LanguageSelectItem value="Malay">Malay</LanguageSelectItem>
|
|
403
|
+ <LanguageSelectItem value="Chinese">Chinese</LanguageSelectItem>
|
|
404
|
+ </LanguageSelect>
|
|
405
|
+ </FormControl> */}
|
|
406
|
+
|
|
407
|
+ <IconButton>
|
|
408
|
+ <SearchIcon className="navItem" style={{
|
|
409
|
+ transition: "all 0.3s ease-in-out",
|
|
410
|
+ color: (isAtTop) ? "white" : "black",
|
|
411
|
+ }} />
|
|
412
|
+ </IconButton>
|
429
|
413
|
|
|
414
|
+ <Badge sx={{ cursor: "pointer" }} onClick={() => { window.location.href = "/cart" }} badgeContent={cartAmount} color="primary">
|
|
415
|
+ <LocalMallIcon className="navItem" style={{
|
|
416
|
+ transition: "all 0.3s ease-in-out",
|
|
417
|
+ color: (isAtTop) ? "white" : "black",
|
|
418
|
+ }} />
|
|
419
|
+ </Badge>
|
|
420
|
+ {/* <IconButton color="inherit">
|
|
421
|
+ <AccountCircleIcon sx={{ color: "white" }} />
|
|
422
|
+ </IconButton> */}
|
|
423
|
+ </Box>
|
|
424
|
+ </Box>
|
430
|
425
|
</Toolbar>
|
431
|
426
|
|
432
|
427
|
{/* On Hover Collection */}
|