Browse Source

remove feature on mobile screen

master
azri 1 week ago
parent
commit
fc4d5216fc
2 changed files with 28 additions and 11 deletions
  1. 9
    0
      src/pages/Products/Product.jsx
  2. 19
    11
      src/pages/Products/index.jsx

+ 9
- 0
src/pages/Products/Product.jsx View File

107
 
107
 
108
 
108
 
109
       <SocialMedia />
109
       <SocialMedia />
110
+      <Box sx={{
111
+        display:{
112
+          xs:"none",
113
+          sm:"none",
114
+          md:"block"
115
+        }
116
+      }}>
110
       <Feature />
117
       <Feature />
118
+      </Box>
119
+      
111
     </Box>
120
     </Box>
112
 
121
 
113
   )
122
   )

+ 19
- 11
src/pages/Products/index.jsx View File

1
-import {useEffect, useState} from 'react'
1
+import { useEffect, useState } from 'react'
2
 import PageTitle from '../../components/PageTitle'
2
 import PageTitle from '../../components/PageTitle'
3
 import Filter from '../../components/Filter'
3
 import Filter from '../../components/Filter'
4
 import ProductList from '../../components/ProductList'
4
 import ProductList from '../../components/ProductList'
10
 
10
 
11
   const [collection, setCollection] = useState(null)
11
   const [collection, setCollection] = useState(null)
12
 
12
 
13
-  useEffect(()=>{
14
-    
13
+  useEffect(() => {
14
+
15
     // if user come from select collection
15
     // if user come from select collection
16
-    if(sessionStorage.getItem('amber-select-product-type')){
16
+    if (sessionStorage.getItem('amber-select-product-type')) {
17
 
17
 
18
-      if(sessionStorage.getItem('amber-select-collection')){
18
+      if (sessionStorage.getItem('amber-select-collection')) {
19
         let selectCollection = JSON.parse(sessionStorage.getItem('amber-select-collection'))
19
         let selectCollection = JSON.parse(sessionStorage.getItem('amber-select-collection'))
20
         setCollection(selectCollection)
20
         setCollection(selectCollection)
21
       }
21
       }
22
-      
23
-    }else{
22
+
23
+    } else {
24
       window.location.href = '/'
24
       window.location.href = '/'
25
     }
25
     }
26
 
26
 
27
-  },[])
27
+  }, [])
28
 
28
 
29
   return (
29
   return (
30
     <>
30
     <>
31
       <Box sx={{
31
       <Box sx={{
32
-        mt:10,
32
+        mt: 10,
33
         px: {
33
         px: {
34
           xs: 2,
34
           xs: 2,
35
           md: 5,
35
           md: 5,
41
           lg: 10
41
           lg: 10
42
         }
42
         }
43
       }}>
43
       }}>
44
-        {collection && <PageTitle title={collection?.title} image={collection?.image?.url} /> }
44
+        {collection && <PageTitle title={collection?.title} image={collection?.image?.url} />}
45
         <ProductList />
45
         <ProductList />
46
         <SocialMedia />
46
         <SocialMedia />
47
-        <Feature />
47
+        <Box sx={{
48
+          display: {
49
+            xs: "none",
50
+            sm: "none",
51
+            md: "block"
52
+          }
53
+        }}>
54
+          <Feature />
55
+        </Box>
48
       </Box>
56
       </Box>
49
     </>
57
     </>
50
   )
58
   )

Loading…
Cancel
Save