Skip to content

Commit

Permalink
Consolidates Hamburger components
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Dec 21, 2023
1 parent 074fa4a commit 02fcf30
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 38 deletions.
8 changes: 4 additions & 4 deletions src/common/Hamburger.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script>
import { createEventDispatcher } from "svelte";
<script lang="ts">
import { ThreeBars16 } from "svelte-octicons";
const dispatch = createEventDispatcher();
let className: string = "";
export { className as class };
</script>

<div class="hamburger">
<button class="svg buttonLike" on:click={(e) => dispatch("toggle")}>
<button class={`svg buttonLike ${className}`} on:click>
<ThreeBars16 />
</button>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/app/MainContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@
<Modal component={UploadEmailDialog} on:close={hideMailkey} />
{/if}
{#if !embed}
<Hamburger on:toggle={emit.expandSidebar} />
<Hamburger
class="plausible-event-name=sidebar-expand"
on:click={emit.expandSidebar}
/>
{/if}
{#if !$documents.error}
<div
Expand Down
5 changes: 4 additions & 1 deletion src/pages/app/sidebar/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

<aside class="sidebar" class:expanded>
<header>
<Hamburger on:toggle={(e) => dispatch("retractSidebar")} />
<Hamburger
class="plausible-event-name=sidebar-retract"
on:click={(e) => dispatch("retractSidebar")}
/>
<Logo />
</header>

Expand Down
7 changes: 5 additions & 2 deletions src/pages/viewer/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import Link from "../../router/Link.svelte";
import Search from "./controls/Search.svelte";
import Hamburger from "./controls/Hamburger.svelte";
import Hamburger from "../../common/Hamburger.svelte";
import { HEADER_HEIGHT } from "./constants.js";
Expand Down Expand Up @@ -60,7 +60,10 @@
<Search />
</div>
<div class="cell">
<Hamburger on:click={(e) => dispatch("toggle.sidebar")} />
<Hamburger
class="plausible-event-name=viewer-hamburger"
on:click={(e) => dispatch("toggle.sidebar")}
/>
</div>
</div>
</header>
Expand Down
17 changes: 0 additions & 17 deletions src/pages/viewer/controls/Hamburger.svelte

This file was deleted.

13 changes: 0 additions & 13 deletions src/pages/viewer/controls/stories/Hamburger.stories.svelte

This file was deleted.

0 comments on commit 02fcf30

Please sign in to comment.