Refactor BeerPostHeader, refactor login and register

- Updated BeerPostHeader in /id page to use semantic HTML tags
- Removed the getServerSidesProps fn in /login and /register. Moved the redirect logic over to the client, will redirect on the client side.
- Added delete BeerPost option on the edit page.
This commit is contained in:
Aaron William Po
2023-03-15 21:30:26 -04:00
parent 584e3b349f
commit 6b12cb72c5
8 changed files with 106 additions and 69 deletions

View File

@@ -1,12 +1,15 @@
import RegisterUserForm from '@/components/RegisterUserForm';
import FormPageLayout from '@/components/ui/forms/FormPageLayout';
import Layout from '@/components/ui/Layout';
import redirectIfLoggedIn from '@/getServerSideProps/redirectIfLoggedIn';
import useRedirectWhenLoggedIn from '@/hooks/useRedirectIfLoggedIn';
import { NextPage } from 'next';
import Head from 'next/head';
import { BiUser } from 'react-icons/bi';
const RegisterUserPage: NextPage = () => {
useRedirectWhenLoggedIn();
return (
<Layout>
<Head>
@@ -26,8 +29,3 @@ const RegisterUserPage: NextPage = () => {
};
export default RegisterUserPage;
export const getServerSideProps = redirectIfLoggedIn({
destination: '/',
permanent: false,
});