From 05f3ce5d20c6b6eb714e032ba522713e9fa1e2aa Mon Sep 17 00:00:00 2001 From: rsandb Date: Fri, 13 Jan 2023 20:34:52 -0600 Subject: [PATCH] Update UserMenu to use Chakra components and include score --- website/src/components/Header/UserMenu.tsx | 124 ++++++--------------- 1 file changed, 36 insertions(+), 88 deletions(-) diff --git a/website/src/components/Header/UserMenu.tsx b/website/src/components/Header/UserMenu.tsx index b99d4a1f..9f225bb6 100644 --- a/website/src/components/Header/UserMenu.tsx +++ b/website/src/components/Header/UserMenu.tsx @@ -1,16 +1,10 @@ -import { Box, Link, Text, useColorModeValue } from "@chakra-ui/react"; -import { Popover } from "@headlessui/react"; -import { AnimatePresence, motion } from "framer-motion"; -import Image from "next/image"; -import NextLink from "next/link"; +import { Avatar, Box, Link, Menu, MenuButton, MenuDivider, MenuItem, MenuList, Text } from "@chakra-ui/react"; import { signOut, useSession } from "next-auth/react"; import React from "react"; import { FiAlertTriangle, FiLayout, FiLogOut, FiSettings, FiShield } from "react-icons/fi"; export function UserMenu() { const { data: session } = useSession(); - const backgroundColor = useColorModeValue("white", "gray.700"); - const accentColor = useColorModeValue("gray.300", "gray.600"); if (!session) { return <>; @@ -47,87 +41,41 @@ export function UserMenu() { } return ( - - {({ open }) => ( - <> - - - Profile Picture -

- {session.user.name || session.user.email} -

-
-
- - {open && ( - - - - - {accountOptions.map((item) => ( - -
-
-
- {item.name} -
- - ))} - signOut({ callbackUrl: "/" })} - > -
- -
-
- Sign Out -
- -
-
-
-
- )} -
- - )} -
+ <> + + + + +

+ {session.user.name || session.user.email} +

+
+
+ + + Your Score + + 3,200 + + + + {accountOptions.map((item) => ( + + + + + ))} + + + signOut({ callbackUrl: "/" })}> + + +
+ ); } }