-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a back button and other visual improvements (#53)
- Loading branch information
Showing
10 changed files
with
74 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { afterNavigate } from "$app/navigation"; | ||
import { page } from "$app/stores"; | ||
import logo from "$lib/assets/logo.png"; | ||
export let label = "Back"; | ||
const disabledUrls = ["/login", "/signup", "/"]; | ||
let documentTitle: string | undefined; | ||
let disabled = true; | ||
afterNavigate(() => { | ||
documentTitle = document?.title; | ||
disabled = disabledUrls.find((url) => $page.url.pathname === url) !== undefined; | ||
}); | ||
</script> | ||
|
||
{#if disabled} | ||
<a class="flex flex-row items-center space-x-2" href="/"> | ||
<img class="h-10 md:h-12" alt="Wishlist Logo" src={logo} /> | ||
<span class="text-primary-900-50-token text-2xl font-bold md:text-3xl">Wishlist</span> | ||
</a> | ||
{:else} | ||
<button class="btn w-fit p-0" type="button" on:click={() => history.back()}> | ||
<!-- <div class="flex flex-row items-center space-x-1"> --> | ||
<iconify-icon icon="ion:arrow-back" /> | ||
|
||
<span class="text-xl">{documentTitle || label}</span> | ||
<!-- </div> --> | ||
</button> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters