|
@@ -17,16 +17,20 @@ const Product = () => {
|
17
|
17
|
let { pid } = useParams();
|
18
|
18
|
const product = useSelector((state) => state.products.product.data)
|
19
|
19
|
const dispatch = useDispatch();
|
20
|
|
-
|
|
20
|
+
|
21
|
21
|
useEffect(() => {
|
22
|
22
|
|
|
23
|
+ window.scrollTo({
|
|
24
|
+ top: 0,
|
|
25
|
+ });
|
|
26
|
+
|
23
|
27
|
dispatch(fetchProduct(pid))
|
24
|
|
-
|
25
|
|
- if(localStorage.getItem('amber-product-history')){
|
|
28
|
+
|
|
29
|
+ if (localStorage.getItem('amber-product-history')) {
|
26
|
30
|
|
27
|
31
|
let productHistory = JSON.parse(localStorage.getItem('amber-product-history'))
|
28
|
|
-
|
29
|
|
- if(productHistory.includes(pid)) return
|
|
32
|
+
|
|
33
|
+ if (productHistory.includes(pid)) return
|
30
|
34
|
|
31
|
35
|
productHistory = [pid, ...productHistory]
|
32
|
36
|
productHistory = productHistory.slice(0, 6)
|
|
@@ -58,7 +62,7 @@ const Product = () => {
|
58
|
62
|
lg: 10
|
59
|
63
|
}
|
60
|
64
|
}}>
|
61
|
|
- <Grid container spacing={0} sx={{ mt: 10, mb:5 }}>
|
|
65
|
+ <Grid container spacing={0} sx={{ mt: 10, mb: 5 }}>
|
62
|
66
|
|
63
|
67
|
<Grid size={{ xs: 12, md: 6 }}>
|
64
|
68
|
<Box sx={{ paddingRight: 1 }}>
|
|
@@ -108,15 +112,15 @@ const Product = () => {
|
108
|
112
|
|
109
|
113
|
<SocialMedia />
|
110
|
114
|
<Box sx={{
|
111
|
|
- display:{
|
112
|
|
- xs:"none",
|
113
|
|
- sm:"none",
|
114
|
|
- md:"block"
|
|
115
|
+ display: {
|
|
116
|
+ xs: "none",
|
|
117
|
+ sm: "none",
|
|
118
|
+ md: "block"
|
115
|
119
|
}
|
116
|
120
|
}}>
|
117
|
|
- <Feature />
|
|
121
|
+ <Feature />
|
118
|
122
|
</Box>
|
119
|
|
-
|
|
123
|
+
|
120
|
124
|
</Box>
|
121
|
125
|
|
122
|
126
|
)
|