浏览代码

clothing need to always be the first

master
azri 4 周前
父节点
当前提交
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,10 +150,11 @@ const Navbar = () => {
150 150
 
151 151
           {/* Left Section: Logo */}
152 152
           <Box sx={{
153
+            mr:5,
153 154
             display: {
154 155
               xs: "none",
155 156
               md: "none",
156
-              lg: "block"
157
+              lg: "block",
157 158
             }
158 159
           }}>
159 160
             <a href="/">

+ 2
- 0
src/components/ProductList/ProductList.jsx 查看文件

@@ -60,6 +60,8 @@ const ProductList = ({ size = 99999 }) => {
60 60
 
61 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,7 +183,14 @@ const getProductTypes = async () => {
183 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 196
 const getCollections = async (name) => {

正在加载...
取消
保存