-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: removing pill menu from ram pages
enhancement: adding back button to return to overview page
- Loading branch information
Showing
2 changed files
with
29 additions
and
23 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 |
---|---|---|
@@ -1,15 +1,33 @@ | ||
<script lang="ts"> | ||
import { ArrowLeft } from 'lucide-svelte'; | ||
import { goto } from '$app/navigation'; | ||
interface Props { | ||
title: string; | ||
subtitle?: string; | ||
inverted?: boolean; | ||
backPath?: string; | ||
} | ||
let props: Props = $props(); | ||
function goBack() { | ||
if (props.backPath) { | ||
goto(props.backPath); | ||
} else { | ||
history.back(); | ||
} | ||
} | ||
</script> | ||
|
||
<header class="flex gap-2" class:flex-col={!props.inverted} class:flex-col-reverse={props.inverted}> | ||
<h1 class="text-3xl font-bold leading-none text-white">{props.title}</h1> | ||
{#if props.subtitle} | ||
<h2 class="text-xl font-medium leading-none text-white/60">{props.subtitle}</h2> | ||
<header class="flex items-center gap-4"> | ||
{#if props.backPath} | ||
<button onclick={goBack} class="text-white hover:text-white/80 focus:outline-none"> | ||
<ArrowLeft size={24} /> | ||
</button> | ||
{/if} | ||
<div class="flex gap-2" class:flex-col={!props.inverted} class:flex-col-reverse={props.inverted}> | ||
<h1 class="text-3xl font-bold leading-none text-white">{props.title}</h1> | ||
{#if props.subtitle} | ||
<h2 class="text-xl font-medium leading-none text-white/60">{props.subtitle}</h2> | ||
{/if} | ||
</div> | ||
</header> |
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