Skip to content

Commit

Permalink
i need sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
d3rpp committed Nov 19, 2024
1 parent d7b8be5 commit 772b126
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/routes/(landing)/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { PageServerLoad, PageServerLoadEvent } from "./$types";

export const load = (({ locals }: PageServerLoadEvent) => {
return {
is_signed_in: locals.user !== null,
};
}) satisfies PageServerLoad;
10 changes: 4 additions & 6 deletions src/routes/(landing)/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { User } from "lucia";
import type { PageServerData } from "./$types";
import type { ValidOauthMethods } from "$lib/server/auth/oauth_methods";
import { goto } from "$app/navigation";
Expand All @@ -10,11 +10,9 @@
import { ArrowRight } from "lucide-svelte";
import { GithubLogo } from "svelte-radix";
interface Props {
user: User | null;
}
const { data }: { data: PageServerData } = $props();
const { user }: Props = $props();
const { is_signed_in } = data;
const oauthLoginGenerator =
(provider: ValidOauthMethods) => (ev: MouseEvent) => {
Expand Down Expand Up @@ -49,7 +47,7 @@
</h1>

<div class="flex flex-1 items-center justify-center">
{#if user != null}
{#if is_signed_in}
<Button
class="flex w-36 flex-row justify-start gap-4"
variant="default"
Expand Down

0 comments on commit 772b126

Please sign in to comment.