diff --git a/website/public/images/temp-avatars/av1.jpg b/website/public/images/temp-avatars/av1.jpg new file mode 100644 index 00000000..0c76c2b7 Binary files /dev/null and b/website/public/images/temp-avatars/av1.jpg differ diff --git a/website/public/images/temp-avatars/av2.jpg b/website/public/images/temp-avatars/av2.jpg new file mode 100644 index 00000000..9eb06f60 Binary files /dev/null and b/website/public/images/temp-avatars/av2.jpg differ diff --git a/website/public/images/temp-avatars/av3.jpg b/website/public/images/temp-avatars/av3.jpg new file mode 100644 index 00000000..402d485f Binary files /dev/null and b/website/public/images/temp-avatars/av3.jpg differ diff --git a/website/public/images/temp-avatars/av4.jpg b/website/public/images/temp-avatars/av4.jpg new file mode 100644 index 00000000..286997af Binary files /dev/null and b/website/public/images/temp-avatars/av4.jpg differ diff --git a/website/public/images/temp-avatars/av5.jpg b/website/public/images/temp-avatars/av5.jpg new file mode 100644 index 00000000..c017c767 Binary files /dev/null and b/website/public/images/temp-avatars/av5.jpg differ diff --git a/website/src/components/Avatar.tsx b/website/src/components/Avatar.tsx new file mode 100644 index 00000000..26bdec0b --- /dev/null +++ b/website/src/components/Avatar.tsx @@ -0,0 +1,96 @@ +import React from "react"; +import { signOut, useSession } from "next-auth/react"; +import Image from "next/image"; +import { Popover } from "@headlessui/react"; +import { AnimatePresence, motion } from "framer-motion"; +import { FaCog, FaSignOutAlt, FaGithub } from "react-icons/fa"; + +export function Avatar() { + const { data: session } = useSession(); + + if (!session) { + return <>; + } + if (session && session.user) { + const email = session.user.email; + const accountOptions = [ + { + name: "Account Settings", + href: "#", + desc: "Account Settings", + icon: FaCog, + //For future use + }, + ]; + return ( + + {({ open }) => ( + <> + +
+ Profile Picture +

{email}

+ {/* Will be changed to username once it is implemented */} +
+
+ + {open && ( + <> + +
+ {accountOptions.map((item) => ( + +
+
+
+

{item.name}

+
+
+ ))} + signOut()} + > +
+ +
+
+

Sign Out

+
+
+
+
+ + )} +
+ + )} +
+ ); + } +} + +export default Avatar; diff --git a/website/src/components/Header.tsx b/website/src/components/Header.tsx index aae657aa..c47982a1 100644 --- a/website/src/components/Header.tsx +++ b/website/src/components/Header.tsx @@ -4,7 +4,9 @@ import { AnimatePresence, motion } from "framer-motion"; import Image from "next/image"; import Link from "next/link"; import { signOut, useSession } from "next-auth/react"; +import { FaUser, FaSignOutAlt } from "react-icons/fa"; +import { Avatar } from "./Avatar"; import { Container } from "./Container"; import { NavLinks } from "./NavLinks"; @@ -40,15 +42,13 @@ function MobileNavLink({ children, ...props }) { function AccountButton() { const { data: session } = useSession(); if (session) { - return ( - - ); + return; } return ( - + ); } @@ -57,7 +57,7 @@ export function Header() { return (
diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 5c7b6acf..6090468c 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -2,6 +2,7 @@ import { useSession } from "next-auth/react"; import Head from "next/head"; import Link from "next/link"; +import { Button, Input, Stack } from "@chakra-ui/react"; import { CallToAction } from "../components/CallToAction"; import { Faq } from "../components/Faq"; @@ -25,7 +26,7 @@ export default function Home() { />
-
+
@@ -45,12 +46,10 @@ export default function Home() { />
-
-

Open Chat Gpt

- -

You are logged in

- - ~Rate a prompt and output now~ +
+