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/generateFlashActGalleryPage.js | 2 +- .../dependencies/generateFlashActSidebar.js | 42 +++++++++++++++------- src/content/dependencies/generateFlashInfoPage.js | 2 +- 3 files changed, 32 insertions(+), 14 deletions(-) (limited to 'src/content') 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, }); }, }; -- cgit 1.3.0-6-gf8a5