Skip to content

Commit 301a8df

Browse files
committed
2 parents 3973224 + e198a94 commit 301a8df

7 files changed

Lines changed: 67 additions & 2 deletions

File tree

src/routes/+error.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</script>
55

66
<div class="flex flex-col justify-center items-center h-screen">
7-
<h1 class="text-9xl">Whoops!</h1>
7+
<h1 class="text-7xl">Whoops!</h1>
88
<h3 class="text-4xl p-4">Something went wrong.. You should try again.</h3>
99
<h9 class="text-lg">If you're curious, that's a {page.status}.</h9>
1010
<Button href="/" variant="secondary" class="mt-6">Home</Button>

src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
>Learn More</Button
2525
>
2626
</div>
27-
</div>
27+
</div>

src/routes/in/+layout.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { LayoutServerLoad } from './$types';
2+
3+
export const load: LayoutServerLoad = async () => {
4+
// TODO: if not logged in, redirect to login page
5+
};

src/routes/in/+layout.ts

Whitespace-only changes.

src/routes/in/+page.server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { PageServerLoad } from './$types';
2+
import { redirect } from '@sveltejs/kit';
3+
4+
export const load: PageServerLoad = async () => {
5+
// if on the /in page, redirect to /in/overview
6+
redirect(303, '/in/overview');
7+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { PageServerLoad } from './$types';
2+
import { redirect } from '@sveltejs/kit';
3+
import { User } from '$lib/models';
4+
import { randomUUID } from 'crypto';
5+
6+
export const load: PageServerLoad = async () => {
7+
// return dummy data for now, until authentication is implemented
8+
const tempUser: User = {
9+
id: randomUUID(),
10+
email: 'avery.bertrand@snhu.edu',
11+
firstname: 'Avery',
12+
lastname: 'Bertrand',
13+
role: 'student',
14+
created_at: new Date().toString(),
15+
updated_at: new Date().toString()
16+
};
17+
return { user: tempUser };
18+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script lang="ts">
2+
import type { PageProps } from "./$types";
3+
import * as Card from "$lib/components/ui/card/index.js";
4+
5+
const { data }: PageProps = $props();
6+
const user = $derived(data.user);
7+
</script>
8+
9+
<div class="min-h-screen flex flex-col items-start justify-center p-4">
10+
<div class="w-[40%]">
11+
<div class="text-left mb-4">
12+
{#if new Date().getHours() < 12}
13+
<h1 class="text-4xl font-bold mb-4">
14+
Good morning, {user.firstname}
15+
</h1>
16+
{:else if new Date().getHours() < 18}
17+
<h1 class="text-4xl font-bold mb-4">
18+
Good afternoon, {user.firstname}
19+
</h1>
20+
{:else}
21+
<h1 class="text-4xl font-bold mb-4">
22+
Good evening, {user.firstname}
23+
</h1>
24+
{/if}
25+
</div>
26+
<div class="w-full">
27+
<Card.Root class="w-full">
28+
<Card.Description>
29+
This is your dashboard. Here you can view your courses,
30+
evaluations, and more.
31+
</Card.Description>
32+
</Card.Root>
33+
</div>
34+
</div>
35+
</div>

0 commit comments

Comments
 (0)