|
3 | 3 | import { createEventDispatcher } from "svelte";
|
4 | 4 | import { browser } from "$app/environment";
|
5 | 5 | import { base } from "$app/paths";
|
| 6 | + import { page } from "$app/stores"; |
6 | 7 |
|
7 | 8 | import CarbonClose from "~icons/carbon/close";
|
8 |
| - import CarbonAdd from "~icons/carbon/add"; |
9 | 9 | import CarbonTextAlignJustify from "~icons/carbon/text-align-justify";
|
| 10 | + import IconNew from "$lib/components/icons/IconNew.svelte"; |
10 | 11 |
|
11 | 12 | export let isOpen = false;
|
12 | 13 | export let title: string | undefined;
|
|
30 | 31 | </script>
|
31 | 32 |
|
32 | 33 | <nav
|
33 |
| - class="flex h-12 items-center justify-between border-b bg-gray-50 px-4 md:hidden dark:border-gray-800 dark:bg-gray-800/70" |
| 34 | + class="flex h-12 items-center justify-between border-b bg-gray-50 px-3 md:hidden dark:border-gray-800 dark:bg-gray-800/70" |
34 | 35 | >
|
35 | 36 | <button
|
36 | 37 | type="button"
|
37 |
| - class="-ml-3 flex h-9 w-9 shrink-0 items-center justify-center" |
| 38 | + class="-ml-3 flex size-12 shrink-0 items-center justify-center text-lg" |
38 | 39 | on:click={() => dispatch("toggle", true)}
|
39 | 40 | aria-label="Open menu"
|
40 | 41 | bind:this={openEl}><CarbonTextAlignJustify /></button
|
41 | 42 | >
|
42 | 43 | <span class="truncate px-4">{title}</span>
|
43 |
| - <a href={`${base}/`} class="-mr-3 flex h-9 w-9 shrink-0 items-center justify-center" |
44 |
| - ><CarbonAdd /></a |
| 44 | + <a |
| 45 | + class:invisible={!$page.params.id} |
| 46 | + href="{base}/" |
| 47 | + class="-mr-3 flex size-12 shrink-0 items-center justify-center text-lg"><IconNew /></a |
45 | 48 | >
|
46 | 49 | </nav>
|
47 | 50 | <nav
|
|
52 | 55 | <div class="flex h-12 items-center px-4">
|
53 | 56 | <button
|
54 | 57 | type="button"
|
55 |
| - class="-mr-3 ml-auto flex h-9 w-9 items-center justify-center" |
| 58 | + class="-mr-3 ml-auto flex size-12 items-center justify-center text-lg" |
56 | 59 | on:click={() => dispatch("toggle", false)}
|
57 | 60 | aria-label="Close menu"
|
58 | 61 | bind:this={closeEl}><CarbonClose /></button
|
|
0 commit comments