mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 02:53:50 +00:00
refactor(#35): iNdEnTaTiOn
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { NavLinkItem } from "$lib/types/Nav/NavLinkItem";
|
import type { NavLinkItem } from '$lib/types/Nav/NavLinkItem';
|
||||||
import type { SupabaseClient } from "@supabase/supabase-js";
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
||||||
import SignOut from "../SignOut.svelte";
|
import SignOut from '../SignOut.svelte';
|
||||||
|
|
||||||
export let linkItem: NavLinkItem;
|
export let linkItem: NavLinkItem;
|
||||||
export let supabase: SupabaseClient | null = null;
|
export let supabase: SupabaseClient | null = null;
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if !linkItem.isSignout}
|
{#if !linkItem.isSignout}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
export let isMobile: boolean;
|
export let isMobile: boolean;
|
||||||
export let supabase: SupabaseClient | null;
|
export let supabase: SupabaseClient | null;
|
||||||
|
|
||||||
|
|
||||||
let isOpen = false;
|
let isOpen = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
if (session) {
|
if (session) {
|
||||||
userAccountLinks.push(
|
userAccountLinks.push({
|
||||||
{
|
|
||||||
text: 'User', // TODO - replace with user's name - will require a database call to get the user's name - suggest setting up a user model to store user data.
|
text: 'User', // TODO - replace with user's name - will require a database call to get the user's name - suggest setting up a user model to store user data.
|
||||||
isParent: true,
|
isParent: true,
|
||||||
isUserAccount: true,
|
isUserAccount: true,
|
||||||
@@ -27,15 +26,12 @@
|
|||||||
isSignout: true
|
isSignout: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
});
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
userAccountLinks.push(
|
userAccountLinks.push({
|
||||||
{
|
|
||||||
text: 'Log in',
|
text: 'Log in',
|
||||||
href: '/login'
|
href: '/login'
|
||||||
},
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { SupabaseClient } from "@supabase/supabase-js";
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
||||||
|
|
||||||
export async function signOut(supabase: SupabaseClient, callback: () => void) {
|
export async function signOut(supabase: SupabaseClient, callback: () => void) {
|
||||||
// TODO use the error from the response
|
// TODO use the error from the response
|
||||||
|
|||||||
Reference in New Issue
Block a user