Browse Source

clothing need to always be the first

master
azri 4 weeks ago
parent
commit
9b38bd8a34

+ 2
- 1
src/components/Navbar/Navbar.jsx View File

150
 
150
 
151
           {/* Left Section: Logo */}
151
           {/* Left Section: Logo */}
152
           <Box sx={{
152
           <Box sx={{
153
+            mr:5,
153
             display: {
154
             display: {
154
               xs: "none",
155
               xs: "none",
155
               md: "none",
156
               md: "none",
156
-              lg: "block"
157
+              lg: "block",
157
             }
158
             }
158
           }}>
159
           }}>
159
             <a href="/">
160
             <a href="/">

+ 2
- 0
src/components/ProductList/ProductList.jsx View File

60
 
60
 
61
     } else if (sessionStorage.getItem('amber-select-category')) {
61
     } else if (sessionStorage.getItem('amber-select-category')) {
62
 
62
 
63
+      
64
+
63
     }
65
     }
64
 
66
 
65
   }, [])
67
   }, [])

+ 8
- 1
src/services/ProductService.js View File

183
     variables: {},
183
     variables: {},
184
   });
184
   });
185
 
185
 
186
-  return data.productTypes.edges
186
+  // make sure clothing to be always the first
187
+  const edges = data.productTypes.edges
188
+  const reorderedEdges = [
189
+    ...edges.filter(edge => edge.node === "clothing"),
190
+    ...edges.filter(edge => edge.node !== "clothing")
191
+  ];
192
+
193
+  return reorderedEdges
187
 }
194
 }
188
 
195
 
189
 const getCollections = async (name) => {
196
 const getCollections = async (name) => {

Loading…
Cancel
Save