Skip to content

Commit

Permalink
feat: onback handler for profile selection
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace committed Feb 15, 2025
1 parent d896dd6 commit b2588f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { cn } from '$lib/functions/classnames';
import type { SubmitFunction } from '@sveltejs/kit';
let { token }: { token?: string } = $props();
let { token, onback }: { token?: string; onback: () => void } = $props();
const handle_submit: SubmitFunction = async () => {
return async () => {
Expand Down Expand Up @@ -35,6 +35,12 @@
}
</script>

<div class="tooltip tooltip-right absolute left-2.5 top-2.5 flex before:capitalize" data-tip="Back">
<button class="btn btn-square btn-circle btn-ghost btn-sm" aria-label="Back" onclick={onback}>
<coreicons-shape-arrow class="size-5" variant="left"></coreicons-shape-arrow>
</button>
</div>

<div class="flex flex-wrap items-center justify-center gap-4 self-center">
{#await fetch_profiles()}
<span class="loading loading-dots loading-md"></span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/(authentication)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</span>
</div>
{#if render_profile_of_type === 'select'}
<ProfileSelect token={login_data?.token} />
<ProfileSelect token={login_data?.token} onback={() => (render_profile_of_type = null)} />
{:else if render_profile_of_type === 'create'}
<div>Profile create</div>
{:else}
Expand Down

0 comments on commit b2588f8

Please sign in to comment.