From 0b00f15c95517c978cada31277789aaa0b148349 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Mon, 20 Nov 2023 18:39:28 -0500 Subject: [PATCH] Refactors Viewer/Sidebar component - Makes the sidebar a presentational component - Refactors the SidebarAction into a standalone component - Programmatically renders sidebar actions - Adds stories for the Sidebar and SidebarAction --- src/pages/viewer/Sidebar.svelte | 358 +++++++++--------- src/pages/viewer/SidebarAction.svelte | 54 +++ src/pages/viewer/Viewer.svelte | 13 +- src/pages/viewer/constants.js | 1 + .../viewer/stories/Sidebar.stories.svelte | 32 ++ .../stories/SidebarAction.stories.svelte | 23 ++ src/viewer/layout.js | 14 +- 7 files changed, 307 insertions(+), 188 deletions(-) create mode 100644 src/pages/viewer/SidebarAction.svelte create mode 100644 src/pages/viewer/stories/Sidebar.stories.svelte create mode 100644 src/pages/viewer/stories/SidebarAction.stories.svelte diff --git a/src/pages/viewer/Sidebar.svelte b/src/pages/viewer/Sidebar.svelte index d6000daac..084287bf6 100644 --- a/src/pages/viewer/Sidebar.svelte +++ b/src/pages/viewer/Sidebar.svelte @@ -1,10 +1,10 @@ - + + + + diff --git a/src/pages/viewer/Viewer.svelte b/src/pages/viewer/Viewer.svelte index 88c7fdf1d..8628d3b77 100644 --- a/src/pages/viewer/Viewer.svelte +++ b/src/pages/viewer/Viewer.svelte @@ -221,7 +221,18 @@ {:else if $doc.mode == "modify"} {/if} - + {#if $layout.showSidebar} + + {/if}