-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rework time and active to use shared navigator
- Loading branch information
1 parent
0ca7511
commit 7d49feb
Showing
10 changed files
with
55 additions
and
82 deletions.
There are no files selected for viewing
File renamed without changes.
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,12 @@ | ||
<script lang="ts"> | ||
import "../../../../app.postcss"; | ||
import TimeNavigator from "$lib/ui/navigators/TimeNavigator.svelte"; | ||
export let data: any; | ||
let { supabase, session } = data; | ||
$: ({ supabase, session } = data); | ||
</script> | ||
|
||
<TimeNavigator subTitle={"Students Online Now"} {supabase} {session}> | ||
<slot /> | ||
</TimeNavigator> |
File renamed without changes.
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,34 +1,12 @@ | ||
<script lang="ts"> | ||
import "../../../../app.postcss"; | ||
import { AppShell } from "@skeletonlabs/skeleton"; | ||
import HomeFooter from "$lib/ui/navigators/footers/HomeFooter.svelte"; | ||
import LayoutMenu from "$lib/ui/navigators/menus/LayoutMenu.svelte"; | ||
import MainNavigator from "$lib/ui/navigators/MainNavigator.svelte"; | ||
import TutorsTitle from "$lib/ui/navigators/titles/TutorsTitle.svelte"; | ||
import { studentsOnlineList } from "./stores"; | ||
import StudentCard from "./StudentCard.svelte"; | ||
</script> | ||
|
||
<AppShell class="h-screen"> | ||
<svelte:fragment slot="header"> | ||
<MainNavigator> | ||
<svelte:fragment slot="lead"> | ||
<TutorsTitle title="Tutors Live Stream" subtitle="online now" /> | ||
</svelte:fragment> | ||
<svelte:fragment slot="trail"> | ||
<span class="divider-vertical h-10 hidden lg:block" /> | ||
<LayoutMenu /> | ||
</svelte:fragment> | ||
</MainNavigator> | ||
</svelte:fragment> | ||
<div class="bg-surface-100-800-token mx-auto mb-2 place-items-center overflow-hidden rounded-xl p-4"> | ||
<div class="flex flex-wrap justify-center"> | ||
{#each $studentsOnlineList as studentLo} | ||
<StudentCard lo={studentLo} /> | ||
{/each} | ||
</div> | ||
<div class="bg-surface-100-800-token mx-auto mb-2 place-items-center overflow-hidden rounded-xl p-4"> | ||
<div class="flex flex-wrap justify-center"> | ||
{#each $studentsOnlineList as studentLo} | ||
<StudentCard lo={studentLo} /> | ||
{/each} | ||
</div> | ||
<svelte:fragment slot="pageFooter"> | ||
<HomeFooter /> | ||
</svelte:fragment> | ||
</AppShell> | ||
</div> |
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,5 @@ | ||
export const load = async ({ locals: { getSession } }) => { | ||
return { | ||
session: await getSession() | ||
}; | ||
}; |
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,12 @@ | ||
<script lang="ts"> | ||
import "../../../../app.postcss"; | ||
import TimeNavigator from "$lib/ui/navigators/TimeNavigator.svelte"; | ||
export let data: any; | ||
let { supabase, session } = data; | ||
$: ({ supabase, session } = data); | ||
</script> | ||
|
||
<TimeNavigator subTitle={"Tutors Time Data"} {supabase} {session}> | ||
<slot /> | ||
</TimeNavigator> |
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,19 @@ | ||
import { createSupabaseLoadClient } from "@supabase/auth-helpers-sveltekit"; | ||
import type { Database } from "../DatabaseDefinitions"; | ||
|
||
export const load = async ({ fetch, data, depends }) => { | ||
depends("supabase:auth"); | ||
|
||
const supabase = createSupabaseLoadClient<Database>({ | ||
supabaseUrl: import.meta.env.VITE_PUBLIC_SUPABASE_URL, | ||
supabaseKey: import.meta.env.VITE_PUBLIC_SUPABASE_ANON_KEY, | ||
event: { fetch }, | ||
serverSession: data.session | ||
}); | ||
|
||
const { | ||
data: { session } | ||
} = await supabase.auth.getSession(); | ||
|
||
return { supabase, session }; | ||
}; |
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
File renamed without changes.
52 changes: 0 additions & 52 deletions
52
app/src/routes/(time)/time/[courseid]/[...userid]/+layout.svelte
This file was deleted.
Oops, something went wrong.