Skip to content

Commit

Permalink
feat: nav minimal variant
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Dec 11, 2024
1 parent 72fe24a commit ffebc6f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
45 changes: 24 additions & 21 deletions src/lib/components/nav/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
interface Props {
user: User | null
minimal?: boolean
}
const { user }: Props = $props()
const { user, minimal }: Props = $props()
// export let user: User | null
Expand Down Expand Up @@ -42,27 +43,29 @@

<div class="spacer"></div>

{#if user}
<NavUserArea {user} />
{:else}
<NavSignArea />
{#if !minimal}
{#if user}
<NavUserArea {user} />
{:else}
<NavSignArea />
{/if}

<div class="menu-button">
<IconButton>
<svg
width="24"
height="25"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M5 6.5H19" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<path d="M5 12.5H19" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<path d="M5 18.5H19" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</IconButton>
</div>
{/if}

<div class="menu-button">
<IconButton>
<svg
width="24"
height="25"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M5 6.5H19" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<path d="M5 12.5H19" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<path d="M5 18.5H19" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</IconButton>
</div>
</div>
</Container>
</nav>
Expand Down
6 changes: 6 additions & 0 deletions src/stories/nav/Nav.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ export const SignedInAsAdmin: Story = {
user: dummyAdminUser
}
}

export const Minimal: Story = {
args: {
minimal: true
}
}

0 comments on commit ffebc6f

Please sign in to comment.