|
|
@@ -1,7 +1,13 @@
|
|
1
|
1
|
import React from 'react';
|
|
2
|
2
|
import { Box, Button, Typography } from '@mui/material';
|
|
3
|
3
|
|
|
4
|
|
-const ProductType = ({ title, img_url }) => {
|
|
|
4
|
+const getProductTypeValue = (title = "") => {
|
|
|
5
|
+ return title?.trim()?.toUpperCase() === "ESSENTIALS" ? "BEAUTY" : title;
|
|
|
6
|
+}
|
|
|
7
|
+
|
|
|
8
|
+const ProductType = ({ title, img_url, clickable = true }) => {
|
|
|
9
|
+ const productTypeValue = getProductTypeValue(title);
|
|
|
10
|
+
|
|
5
|
11
|
return (
|
|
6
|
12
|
<Box
|
|
7
|
13
|
sx={{
|
|
|
@@ -29,15 +35,25 @@ const ProductType = ({ title, img_url }) => {
|
|
29
|
35
|
alignItems: 'center',
|
|
30
|
36
|
color: '#fff', // Text and button color for visibility
|
|
31
|
37
|
transition: "all 0.5s ease-in-out",
|
|
|
38
|
+ cursor: clickable ? 'pointer' : 'default',
|
|
32
|
39
|
":hover":{
|
|
33
|
40
|
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
34
|
41
|
}
|
|
35
|
42
|
}}
|
|
36
|
|
- onClick={() => {
|
|
37
|
|
- sessionStorage.setItem('amber-select-product-type', title)
|
|
|
43
|
+ // onClick={() => {
|
|
|
44
|
+ // sessionStorage.setItem('amber-select-product-type', title)
|
|
|
45
|
+ // sessionStorage.removeItem('amber-select-collection')
|
|
|
46
|
+ // window.location.href = '/products'
|
|
|
47
|
+ // }}
|
|
|
48
|
+ onClick={clickable ? () => {
|
|
|
49
|
+ sessionStorage.setItem('amber-select-product-type', productTypeValue)
|
|
38
|
50
|
sessionStorage.removeItem('amber-select-collection')
|
|
|
51
|
+ sessionStorage.removeItem('amber-select-collections')
|
|
|
52
|
+ if (title?.trim()?.toUpperCase() === "ESSENTIALS") {
|
|
|
53
|
+ sessionStorage.setItem('amber-select-collections', JSON.stringify(["COSMETICS", "HAND & BODY LOTION"]))
|
|
|
54
|
+ }
|
|
39
|
55
|
window.location.href = '/products'
|
|
40
|
|
- }}
|
|
|
56
|
+ } : undefined}
|
|
41
|
57
|
>
|
|
42
|
58
|
{/* <Typography variant="h5" gutterBottom sx={{ fontWeight: "600", letterSpacing: 7, marginRight:"-0.4em" }}>
|
|
43
|
59
|
{title?.toUpperCase()}
|