From 4cf9432f0e777d4e887fb19bfa8afc6843adae25 Mon Sep 17 00:00:00 2001 From: Sean Lynch Date: Wed, 10 Jan 2024 22:32:10 -0500 Subject: [PATCH] Collapse app header actions into menu on small viewports. Resolves #185 --- packages/svelte-ux/src/routes/+layout.svelte | 83 ++++++++++++++------ 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/packages/svelte-ux/src/routes/+layout.svelte b/packages/svelte-ux/src/routes/+layout.svelte index fc8abe81b..a26d25562 100644 --- a/packages/svelte-ux/src/routes/+layout.svelte +++ b/packages/svelte-ux/src/routes/+layout.svelte @@ -2,11 +2,12 @@ import { onMount } from 'svelte'; import posthog from 'posthog-js'; import 'prism-themes/themes/prism-vsc-dark-plus.css'; - import { mdiArrowTopRight, mdiGithub, mdiTwitter } from '@mdi/js'; + import { mdiArrowTopRight, mdiDotsVertical, mdiGithub, mdiTwitter } from '@mdi/js'; import AppBar from '$lib/components/AppBar.svelte'; import AppLayout from '$lib/components/AppLayout.svelte'; import Button from '$lib/components/Button.svelte'; + import MenuButton from '$lib/components/MenuButton.svelte'; import NavMenu from './_NavMenu.svelte'; import QuickSearch from '$lib/components/QuickSearch.svelte'; import ThemeSelect from '$lib/components/ThemeSelect.svelte'; @@ -18,6 +19,7 @@ import { page } from '$app/stores'; import { settings } from '$lib/components/settings'; + import { lgScreen } from '$lib/stores/matchMedia'; import type { PageData } from './$types'; import { createLocaleSettings } from '$lib'; @@ -151,7 +153,7 @@ href="https://www.layerchart.com" icon={{ data: mdiArrowTopRight, class: 'opacity-50' }} target="_blank" - class="p-2 max-md:hidden flex-row-reverse" + class="p-2 max-lg:hidden flex-row-reverse" > LayerChart @@ -167,27 +169,62 @@ {/if} - -