-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.tsx
More file actions
54 lines (46 loc) · 1.31 KB
/
page.tsx
File metadata and controls
54 lines (46 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use server";
import { getSessionUser } from "@/lib/user/getSessionUser";
import { isRegistered } from "@/lib/user/registration";
import Client from "@/components/refferal"
import Link from "next/link";
import {
StarBackground,
} from 'eclipse-components'
/**
* Home Page element
* @returns JSX.element
*/
export default async function Home() {
const user = await getSessionUser();
const preRegistered = await isRegistered();
return (
<main className="p-4 text-left">
{/* <StarBackground/> */}
<h1 className="text-3xl">
{user ? `Welcome ${user.firstName}!` : "Not logged in."}
</h1>
{user ? (
<div>
<Link href={`/logout`} className="underline">
Logout
</Link>
<br />
<Link href={`/settings`} className="underline">
Settings
</Link>
<br />
{preRegistered ? (
<div>
<p> You have preregistered, you can invite up to 10 of your friends! </p>
<Client users={user?.referrals}/>
</div> ) : ("You are not yet preregistered. ")}
</div>
) : (
<Link href={`${process.env.AUTH_DOMAIN}/login?callbackUrl=${process.env.DASH_DOMAIN}`} className="underline">
Login
</Link>
)}
<br />
</main>
);
}