From 5e861e1b042cbc5d6684f12dd0d3deb52ad70697 Mon Sep 17 00:00:00 2001 From: wil Date: Tue, 3 Sep 2024 18:54:03 -0400 Subject: [PATCH] upgrade and simplify profile dropdown code --- src/components/features/ProfileDropdown.tsx | 98 ++++++++++----------- 1 file changed, 46 insertions(+), 52 deletions(-) diff --git a/src/components/features/ProfileDropdown.tsx b/src/components/features/ProfileDropdown.tsx index 79b2aebeb8..7b79d7b07d 100644 --- a/src/components/features/ProfileDropdown.tsx +++ b/src/components/features/ProfileDropdown.tsx @@ -1,20 +1,13 @@ -import { Fragment } from "react"; import { useSignals } from "@preact/signals-react/runtime"; +import { twMerge } from "tailwind-merge"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { - faCaretDown, + faChevronDown, faRightFromBracket, faUser, } from "@fortawesome/pro-thin-svg-icons"; -import { - Menu, - MenuButton, - MenuItem, - MenuItems, - Transition, -} from "@headlessui/react"; +import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react"; import { Gravatar } from "../ui/Gravatar"; -import { twMerge } from "tailwind-merge"; import { authentication } from "~/signals"; @@ -48,8 +41,10 @@ export function ProfileDropdown() { return ( - + + - -
- - - {() => ( - - - My Profile - - )} - - {options.map((option, index) => ( - - {() => ( - - )} - - ))} - -
-
+ + + My Profile + + {options.map((option, index) => ( + + + {option.label} + + ))} +
); }