From 635c54d883e2f6e8ea1fbae09a305667335924ea Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 3 Apr 2024 13:43:26 -0300 Subject: content: generateFlashActSidebar: base on generatePageSidebar --- .../dependencies/generateFlashActSidebar.js | 42 +++++++++++++++------- 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'src/content/dependencies/generateFlashActSidebar.js') 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]), - }; + }); }, }; -- cgit 1.3.0-6-gf8a5