Fix hydration error & auth button
This commit is contained in:
@@ -6,10 +6,8 @@ export default function Footer() {
|
|||||||
<>
|
<>
|
||||||
<div className="absolute bottom-0 left-0 w-full bg-gray-900 p-2 text-white">
|
<div className="absolute bottom-0 left-0 w-full bg-gray-900 p-2 text-white">
|
||||||
<p className="text-center">
|
<p className="text-center">
|
||||||
<Link href="mailto:alex@alexavfrantz.com">
|
<Link href="mailto:alex@alexavfrantz.com" className="hover:text-gray-500 hover:underline hover:cursor-pointer">
|
||||||
<p className="hover:text-gray-500 hover:underline hover:cursor-pointer">
|
|
||||||
alex@alexavfrantz.com
|
alex@alexavfrantz.com
|
||||||
</p>
|
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
<p className="text-center">
|
<p className="text-center">
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {useSession, signIn, signOut} from 'next-auth/react';
|
import {useSession, signIn, signOut} from 'next-auth/react';
|
||||||
import Head from 'next/head';
|
|
||||||
import HeaderItem from "./HeaderItem";
|
import HeaderItem from "./HeaderItem";
|
||||||
|
|
||||||
export default function Header() {
|
export default function Header() {
|
||||||
@@ -12,7 +11,13 @@ export default function Header() {
|
|||||||
<div className="inline-block pb-2">
|
<div className="inline-block pb-2">
|
||||||
<HeaderItem content="home" linkTo="/" />
|
<HeaderItem content="home" linkTo="/" />
|
||||||
<HeaderItem content="reviews" linkTo="/reviews" />
|
<HeaderItem content="reviews" linkTo="/reviews" />
|
||||||
<HeaderItem content={status == "unauthenticated" ? "login" : "logout" } onClick={status == "authenticated" ? signOut : signIn} linkTo="" />
|
<HeaderItem content={status == "unauthenticated" ? "login" : "logout" } onClick={async () => {
|
||||||
|
if (status == "unauthenticated") {
|
||||||
|
await signIn()
|
||||||
|
} else {
|
||||||
|
await signOut()
|
||||||
|
}
|
||||||
|
}} linkTo="" />
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user