-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from agrattan0820/dev
v0.3.12
- Loading branch information
Showing
17 changed files
with
548 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import AccountContent from "@ai/components/account-content"; | ||
import Footer from "@ai/components/footer"; | ||
import Header from "@ai/components/header"; | ||
import { authOptions } from "@ai/pages/api/auth/[...nextauth]"; | ||
import { getServerSession } from "next-auth"; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default async function Account() { | ||
const session = await getServerSession(authOptions()); | ||
|
||
if (!session) { | ||
redirect("/"); | ||
} | ||
|
||
return ( | ||
<> | ||
<Header session={session} /> | ||
<main className="relative flex min-h-[100dvh] flex-col justify-center"> | ||
<AccountContent session={session} /> | ||
</main> | ||
<Footer /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
"use client"; | ||
|
||
import Image from "next/image"; | ||
import Button from "./button"; | ||
// import { useRef } from "react"; | ||
// import { FiX } from "react-icons/fi"; | ||
import { Session } from "next-auth"; | ||
import { signOut } from "next-auth/react"; | ||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
export default function AccountContent({ session }: { session: Session }) { | ||
// const dialogRef = useRef<HTMLDialogElement>(null); | ||
|
||
const handleSignOut = () => { | ||
Sentry.setUser(null); | ||
signOut(); | ||
}; | ||
|
||
// const handleDeleteAccount = () => { | ||
// Sentry.setUser(null); | ||
// signOut(); | ||
// }; | ||
|
||
return ( | ||
<> | ||
<section className="container mx-auto flex flex-col items-center justify-center gap-4 px-4"> | ||
<h1 className="mb-8 text-2xl">Your Account</h1> | ||
{session.user.image && ( | ||
<Image | ||
src={session.user.image} | ||
alt={`${session.user.name}'s Google profile image`} | ||
width={64} | ||
height={64} | ||
className="h-16 w-16 rounded-full shadow" | ||
/> | ||
)} | ||
<div> | ||
<p>Name: {session.user.name}</p> | ||
<p>Email: {session.user.email}</p> | ||
</div> | ||
<Button onClick={handleSignOut}>Sign Out</Button> | ||
{/* TODO: finish ability to delete account */} | ||
{/* <SecondaryButton onClick={() => dialogRef.current?.showModal()}> | ||
Delete Account | ||
</SecondaryButton> */} | ||
</section> | ||
{/* TODO: finish ability to delete account */} | ||
{/* <dialog | ||
ref={dialogRef} | ||
className="relative mx-auto w-full max-w-2xl rounded-xl p-8 transition backdrop:bg-slate-900/50 open:animate-modal open:backdrop:animate-modal" | ||
> | ||
<form method="dialog"> | ||
<button className="absolute right-4 top-4 text-xl md:text-2xl"> | ||
<FiX /> | ||
</button> | ||
<p className="text-2xl"> | ||
Are you sure you would like to delete your account? | ||
</p> | ||
<div className="mt-8 flex gap-2"> | ||
<Button>No, nevermind</Button> | ||
<SecondaryButton onClick={handleDeleteAccount}> | ||
Yes, delete my account | ||
</SecondaryButton> | ||
</div> | ||
</form> | ||
</dialog> */} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Session } from "next-auth"; | ||
import Menu from "./menu"; | ||
|
||
type HeaderProps = { | ||
session: Session | null; | ||
}; | ||
|
||
const Header = ({ session }: HeaderProps) => { | ||
return ( | ||
<header className="container absolute left-0 right-0 top-4 z-50 mx-auto mt-4 flex justify-end gap-4 px-4 md:top-8"> | ||
<Menu session={session} /> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header; |
Oops, something went wrong.
22a6b70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
artificial-unintelligence – ./
www.artificialunintelligence.gg
artificial-unintelligence-agrattan.vercel.app
un-ai.vercel.app
dev.artificialunintelligence.gg
artificial-unintelligence-git-main-agrattan.vercel.app
artificialunintelligence.gg