Ver Fonte

footer部分接口调整

fogwind há 3 dias atrás
pai
commit
617d485946
1 ficheiros alterados com 8 adições e 15 exclusões
  1. 8 15
      src/components/layout/footer/FooterMenu.tsx

+ 8 - 15
src/components/layout/footer/FooterMenu.tsx

@@ -27,21 +27,14 @@ export default function FooterMenu({
         const edgeItem = res.data?.themeCustomizations.edges[0];
         if(edgeItem) {
             const options = JSON.parse(edgeItem.node.translation.options);
-            linkList[0] = {
-                title: "Asteria Hair",
-                id: "column_1",
-                list: options['column_1'] || []
-            };
-            linkList[1] = {
-                title: "Guide",
-                id: "column_2",
-                list: options['column_2'] || []
-            };
-            linkList[2] = {
-                title: "How Can We Help",
-                id: "column_3",
-                list: options['column_3'] || []
-            };
+            const columnLabels: Record<string,string> = options['column_labels'];
+            for (const [key, value] of Object.entries(columnLabels)) {
+                linkList.push( {
+                    title: value,
+                    id: key,
+                    list: options[key] || []
+                });
+            }
         }
     }