File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 2424 >Learn More</Button
2525 >
2626 </div >
27- </div >
27+ </div >
Original file line number Diff line number Diff line change 1+ import type { LayoutServerLoad } from './$types' ;
2+
3+ export const load : LayoutServerLoad = async ( ) => {
4+ // TODO: if not logged in, redirect to login page
5+ } ;
Original file line number Diff line number Diff line change 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+ } ;
Original file line number Diff line number Diff line change 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+ } ;
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments