« get me outta code hell

content: generateFlashActSidebar: base on generatePageSidebar - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-03 13:43:26 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-03 16:55:12 -0300
commit635c54d883e2f6e8ea1fbae09a305667335924ea (patch)
tree72cbbc4f93098ddf5d6ea85d27cf102044ac3084 /src
parent2790970d85a5f4c03cea02af2cd2fb2218f15ff1 (diff)
content: generateFlashActSidebar: base on generatePageSidebar
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateFlashActGalleryPage.js2
-rw-r--r--src/content/dependencies/generateFlashActSidebar.js42
-rw-r--r--src/content/dependencies/generateFlashInfoPage.js2
3 files changed, 32 insertions, 14 deletions
diff --git a/src/content/dependencies/generateFlashActGalleryPage.js b/src/content/dependencies/generateFlashActGalleryPage.js
index 8eea58bb..17078124 100644
--- a/src/content/dependencies/generateFlashActGalleryPage.js
+++ b/src/content/dependencies/generateFlashActGalleryPage.js
@@ -85,7 +85,7 @@ export default {
 
       navBottomRowContent: relations.flashActNavAccent,
 
-      ...relations.sidebar,
+      leftSidebar: relations.sidebar,
     });
   },
 };
diff --git a/src/content/dependencies/generateFlashActSidebar.js b/src/content/dependencies/generateFlashActSidebar.js
index 674d9ff9..7c1aae7d 100644
--- a/src/content/dependencies/generateFlashActSidebar.js
+++ b/src/content/dependencies/generateFlashActSidebar.js
@@ -1,7 +1,14 @@
 import {stitchArrays} from '#sugar';
 
 export default {
-  contentDependencies: ['linkFlash', 'linkFlashAct', 'linkFlashIndex'],
+  contentDependencies: [
+    'generatePageSidebar',
+    'generatePageSidebarBox',
+    'linkFlash',
+    'linkFlashAct',
+    'linkFlashIndex',
+  ],
+
   extraDependencies: ['getColors', 'html', 'language', 'wikiData'],
 
   sprawl: ({flashActData, flashSideData}) => ({flashActData, flashSideData}),
@@ -53,6 +60,15 @@ export default {
   },
 
   relations: (relation, query, sprawl, act, _flash) => ({
+    sidebar:
+      relation('generatePageSidebar'),
+
+    currentActBox:
+      relation('generatePageSidebarBox'),
+
+    sideMapBox:
+      relation('generatePageSidebarBox'),
+
     currentActLink:
       relation('linkFlashAct', act),
 
@@ -144,21 +160,23 @@ export default {
             ])),
     ]);
 
-    const sideMapBox = {
-      class: 'flash-act-map-sidebar-box',
-      content: sideMapBoxContent,
-    };
+    const sideMapBox =
+      relations.sideMapBox.slots({
+        attributes: {class: 'flash-act-map-sidebar-box'},
+        content: sideMapBoxContent,
+      });
 
-    const currentActBox = {
-      class: 'flash-current-act-sidebar-box',
-      content: currentActBoxContent,
-    };
+    const currentActBox =
+      relations.currentActBox.slots({
+        attributes: {class: 'flash-current-act-sidebar-box'},
+        content: currentActBoxContent,
+      });
 
-    return {
-      leftSidebarMultiple:
+    return relations.sidebar.slots({
+      boxes:
         (data.isFlashActPage
           ? [sideMapBox, currentActBox]
           : [currentActBox, sideMapBox]),
-    };
+    });
   },
 };
diff --git a/src/content/dependencies/generateFlashInfoPage.js b/src/content/dependencies/generateFlashInfoPage.js
index c60f9696..b88ce982 100644
--- a/src/content/dependencies/generateFlashInfoPage.js
+++ b/src/content/dependencies/generateFlashInfoPage.js
@@ -169,7 +169,7 @@ export default {
 
       navBottomRowContent: sec.nav.flashNavAccent,
 
-      ...relations.sidebar,
+      leftSidebar: relations.sidebar,
     });
   },
 };