feat: create confirm user page, option to resend email if link expires

This commit is contained in:
Aaron William Po
2023-05-29 15:51:59 -04:00
parent bc298bce0e
commit 06ae380b8f
9 changed files with 210 additions and 41 deletions

View File

@@ -5,6 +5,7 @@ import UserContext from '@/contexts/UserContext';
import { GetServerSideProps, NextPage } from 'next';
import { useContext } from 'react';
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
import Head from 'next/head';
const ProtectedPage: NextPage = () => {
const { user, isLoading } = useContext(UserContext);
@@ -17,22 +18,27 @@ const ProtectedPage: NextPage = () => {
const isDesktop = useMediaQuery('(min-width: 768px)');
return (
<div className="flex h-full flex-col items-center justify-center space-y-3 bg-primary text-center">
{isLoading && <Spinner size={isDesktop ? 'xl' : 'md'} />}
{user && !isLoading && (
<>
<h1 className="text-2xl font-bold lg:text-7xl">
Good {isMorning && 'morning'}
{isAfternoon && 'afternoon'}
{isEvening && 'evening'}
{`, ${user?.firstName}!`}
</h1>
<h2 className="text-xl font-bold lg:text-4xl">
Welcome to the Biergarten App!
</h2>
</>
)}
</div>
<>
<Head>
<title>Hello, {user?.firstName}! | The Biergarten App</title>
</Head>
<div className="flex h-full flex-col items-center justify-center space-y-3 bg-primary text-center">
{isLoading && <Spinner size={isDesktop ? 'xl' : 'md'} />}
{user && !isLoading && (
<>
<h1 className="text-2xl font-bold lg:text-7xl">
Good {isMorning && 'morning'}
{isAfternoon && 'afternoon'}
{isEvening && 'evening'}
{`, ${user?.firstName}!`}
</h1>
<h2 className="text-xl font-bold lg:text-4xl">
Welcome to the Biergarten App!
</h2>
</>
)}
</div>
</>
);
};