Skip to content

Commit a03d289

Browse files
authored
Mobile navs: bigger buttons and hide new? (#720)
* bigger buttons and hide new * icon update
1 parent dc86148 commit a03d289

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

src/lib/components/MobileNav.svelte

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
import { createEventDispatcher } from "svelte";
44
import { browser } from "$app/environment";
55
import { base } from "$app/paths";
6+
import { page } from "$app/stores";
67
78
import CarbonClose from "~icons/carbon/close";
8-
import CarbonAdd from "~icons/carbon/add";
99
import CarbonTextAlignJustify from "~icons/carbon/text-align-justify";
10+
import IconNew from "$lib/components/icons/IconNew.svelte";
1011
1112
export let isOpen = false;
1213
export let title: string | undefined;
@@ -30,18 +31,20 @@
3031
</script>
3132

3233
<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"
3435
>
3536
<button
3637
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"
3839
on:click={() => dispatch("toggle", true)}
3940
aria-label="Open menu"
4041
bind:this={openEl}><CarbonTextAlignJustify /></button
4142
>
4243
<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
4548
>
4649
</nav>
4750
<nav
@@ -52,7 +55,7 @@
5255
<div class="flex h-12 items-center px-4">
5356
<button
5457
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"
5659
on:click={() => dispatch("toggle", false)}
5760
aria-label="Close menu"
5861
bind:this={closeEl}><CarbonClose /></button
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script lang="ts">
2+
export let classNames = "";
3+
</script>
4+
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
class={classNames}
8+
width="1em"
9+
height="1em"
10+
fill="none"
11+
viewBox="0 0 32 32"
12+
><path
13+
fill="currentColor"
14+
fill-rule="evenodd"
15+
d="M3.143 20.286h4.286v2.142H3.143A2.143 2.143 0 0 1 1 20.287V3.143A2.143 2.143 0 0 1 3.143 1h17.143a2.143 2.143 0 0 1 2.142 2.143v4.286h-2.142V3.143H3.143v17.143Zm9.643-12.857v3.214H16v2.143h-3.214V16h-2.143v-3.214H7.429v-2.143h3.214V7.429h2.143Zm14.185 2.639 3.533 3.532a1.7 1.7 0 0 1 0 2.4L15.5 31H9.57v-5.928l15-15.004a1.7 1.7 0 0 1 2.4 0Zm-15.257 18.79h2.897l10.116-10.116-2.899-2.897L11.714 25.96v2.897ZM23.346 14.33l2.897 2.897 2.429-2.43-2.897-2.896-2.43 2.429Z"
16+
clip-rule="evenodd"
17+
/></svg
18+
>

0 commit comments

Comments
 (0)