瀏覽代碼

clothing need to always be the first

master
azri 11 月之前
父節點
當前提交
9b38bd8a34
共有 3 個檔案被更改,包括 12 行新增2 行删除
  1. 2
    1
      src/components/Navbar/Navbar.jsx
  2. 2
    0
      src/components/ProductList/ProductList.jsx
  3. 8
    1
      src/services/ProductService.js

+ 2
- 1
src/components/Navbar/Navbar.jsx 查看文件

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 查看文件

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 查看文件

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…
取消
儲存