diff --git a/src/app/WardrobePage/ItemsPanel.js b/src/app/WardrobePage/ItemsPanel.js index 292c295e..0cbc3dad 100644 --- a/src/app/WardrobePage/ItemsPanel.js +++ b/src/app/WardrobePage/ItemsPanel.js @@ -10,13 +10,18 @@ import { Skeleton, Tooltip, VisuallyHidden, + Menu, + MenuButton, + MenuList, + MenuItem, + Portal, } from "@chakra-ui/react"; import { EditIcon, QuestionIcon } from "@chakra-ui/icons"; import { CSSTransition, TransitionGroup } from "react-transition-group"; import { Delay, Heading1, Heading2 } from "../util"; import Item, { ItemListContainer, ItemListSkeleton } from "./Item"; -import WIPCallout from "../components/WIPCallout"; +import { MdMoreVert } from "react-icons/md"; /** * ItemsPanel shows the items in the current outfit, and lets the user toggle @@ -239,58 +244,60 @@ function ItemZoneGroupSkeleton({ itemCount }) { /** * OutfitHeading is an editable outfit name, as a big pretty page heading! + * It also contains the outfit menu, for saving etc. */ function OutfitHeading({ outfitState, dispatchToOutfit }) { return ( - - - - - - dispatchToOutfit({ type: "rename", outfitName: value }) - } - > - {({ isEditing, onEdit }) => ( - - - - {!isEditing && ( - - } - variant="link" - aria-label="Edit outfit name" - title="Edit outfit name" - /> - - )} - - )} - - - - - {outfitState.id && ( - - Saved outfits are WIP! - + // The Editable wraps everything, including the menu, because the menu has + // a Rename option. + + dispatchToOutfit({ type: "rename", outfitName: value }) + } + > + {({ onEdit }) => ( + + + + + + + + + + + } + aria-label="Outfit menu" + borderRadius="full" + fontSize="24px" + opacity="0.8" + /> + + + } + onClick={() => { + // Start the rename after a tick, so finishing up the click + // won't just immediately remove focus from the Editable. + setTimeout(onEdit, 0); + }} + > + Rename + + + + + )} - + ); }