Skip to content

Commit

Permalink
Merge pull request #71 from UrbanInstitute/navbar-projectUrl-tweak
Browse files Browse the repository at this point in the history
added case for no projectUrl
  • Loading branch information
rachelmarconi authored Apr 19, 2024
2 parents b054132 + 6e2d031 commit 113b4f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fixes package name in documentation
- Fixes Intro code chunk to be up to date
- Changes snake_case variables to camelCase
- Add Navbar case for no projectUrl with story documentation

## v0.7.1

Expand Down
11 changes: 9 additions & 2 deletions src/lib/Navbar/Navbar.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@
<Story name="Default" />

<Story
name="With title"
name="With title, no project link"
args={{
title: "Project title"
}}
/>

<Story
name="With title and project link"
args={{
title: "Project title",
projectUrl: "https://urban.org"
Expand All @@ -55,7 +62,7 @@
name="TPC"
args={{
title: "Project title",
projectUrl: "https://urban.org",
projectUrl: "https://taxpolicycenter.org",
brand: "tpc"
}}
/>
6 changes: 5 additions & 1 deletion src/lib/Navbar/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* URL to link to from the title
* @type {string}
*/
export let projectUrl;
export let projectUrl = "";
/**
* Brand to use for the logo
Expand Down Expand Up @@ -40,9 +40,13 @@
</a>
</div>
{#if title}
{#if projectUrl}
<a href="{projectUrl}/">
<p class="nav--page-title">{title}</p>
</a>
{:else}
<p class="nav--page-title">{title}</p>
{/if}
{/if}
</nav>

Expand Down

0 comments on commit 113b4f3

Please sign in to comment.