refactor(#35): iNdEnTaTiOn

This commit is contained in:
OllyNicholass
2024-10-29 21:46:52 +00:00
parent 550d9bac18
commit d49f4b2c38
7 changed files with 49 additions and 55 deletions
+3 -4
View File
@@ -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 -1
View File
@@ -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