From 7d668f5c939a2c8a5e65126bde3bb092d56d42bd Mon Sep 17 00:00:00 2001 From: wil Date: Tue, 3 Sep 2024 16:49:40 -0400 Subject: [PATCH] profile dropdown colors, toolbar bringing up subtoolbar --- src/components/features/ProfileDropdown.tsx | 61 ++++++++----------- .../features/ToolbarMain/ToolbarButtons.tsx | 17 +++++- src/components/features/ToolbarMain/index.tsx | 38 +++++++++++- 3 files changed, 78 insertions(+), 38 deletions(-) diff --git a/src/components/features/ProfileDropdown.tsx b/src/components/features/ProfileDropdown.tsx index 27c24d57ab..79b2aebeb8 100644 --- a/src/components/features/ProfileDropdown.tsx +++ b/src/components/features/ProfileDropdown.tsx @@ -69,43 +69,36 @@ export function ProfileDropdown() { leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - - - {({ active }) => ( - - - My Profile - - )} - - {options.map((option, index) => ( - - {({ active }) => ( - + + My Profile + )} - ))} - + {options.map((option, index) => ( + + {() => ( + + )} + + ))} + + ); diff --git a/src/components/features/ToolbarMain/ToolbarButtons.tsx b/src/components/features/ToolbarMain/ToolbarButtons.tsx index 61884d53f5..9a5d7a9724 100644 --- a/src/components/features/ToolbarMain/ToolbarButtons.tsx +++ b/src/components/features/ToolbarMain/ToolbarButtons.tsx @@ -1,3 +1,5 @@ +import { ButtonHTMLAttributes } from "react"; +import { twMerge } from "tailwind-merge"; import { FontAwesomeIcon, FontAwesomeIconProps, @@ -6,13 +8,26 @@ import { IconDefinition } from "@fortawesome/pro-thin-svg-icons"; export const ToolbarButtons = ({ icon, + onClick, + buttonProps = { className: "" }, iconProps, }: { icon: IconDefinition; + onClick?: () => void; + buttonProps?: ButtonHTMLAttributes; iconProps?: Omit; }) => { + const { className: buttonClassName, ...restButtonProps } = buttonProps; + const mergedButtonClasses = twMerge( + "size-10 rounded-2xl p-2 hover:bg-secondary-500 hover:text-white", + buttonClassName, + ); return ( - ); diff --git a/src/components/features/ToolbarMain/index.tsx b/src/components/features/ToolbarMain/index.tsx index 02fd15148d..a7eaefc765 100644 --- a/src/components/features/ToolbarMain/index.tsx +++ b/src/components/features/ToolbarMain/index.tsx @@ -1,12 +1,16 @@ // import { useSignals } from "@preact/signals-react/runtime"; +import { useState } from "react"; import { faArrowRotateLeft, faArrowRotateRight, faBars, + faCameraRotate, faDownload, - faFloppyDisk, faFilePlus, + faFilm, + faFloppyDisk, faHand, + faImage, faLocationArrow, faPlus, faMinus, @@ -14,6 +18,7 @@ import { } from "@fortawesome/pro-thin-svg-icons"; import { ToolbarButtons } from "./ToolbarButtons"; +import { twMerge } from "tailwind-merge"; // import { layout } from "~/signals"; @@ -22,9 +27,17 @@ export const ToolbarMain = () => { // const { // signals: { isMobile, windowWidth, windowHeight }, // } = layout; + const [isUploadSubmenuOpen, setIsUploadSubmenuOpen] = useState(false); + const panelClasses = + "rounded-2xl border border-ui-border bg-ui-panel p-2 shadow-xl"; return (
-
+
{/*

Layout is {windowWidth.value} x {windowHeight.value},{" "} {isMobile.value ? "Mobile" : "Not Mobile"} @@ -36,13 +49,32 @@ export const ToolbarMain = () => { iconProps={{ className: "fa-flip-horizontal" }} /> - +

+ { + setIsUploadSubmenuOpen(true); + }} + /> + {isUploadSubmenuOpen && ( +
+ + +
+ )} +
100% +