diff options
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 |
commit | 635c54d883e2f6e8ea1fbae09a305667335924ea (patch) | |
tree | 72cbbc4f93098ddf5d6ea85d27cf102044ac3084 /src/content/dependencies/generateFlashActSidebar.js | |
parent | 2790970d85a5f4c03cea02af2cd2fb2218f15ff1 (diff) |
content: generateFlashActSidebar: base on generatePageSidebar
Diffstat (limited to 'src/content/dependencies/generateFlashActSidebar.js')
-rw-r--r-- | src/content/dependencies/generateFlashActSidebar.js | 42 |
1 files changed, 30 insertions, 12 deletions
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]), - }; + }); }, }; |