From 4b2d1f949bf040df5303e622aac5fcb917f1cef4 Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 15 Aug 2022 19:28:08 -0700 Subject: [PATCH] Finally implement "Edit a copy" I guess "Coming soon" was a lie oops lmao it was bothering me so I finally added it :p --- src/app/WardrobePage/ItemsPanel.js | 12 ++++++++++-- src/app/WardrobePage/useOutfitState.js | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app/WardrobePage/ItemsPanel.js b/src/app/WardrobePage/ItemsPanel.js index f8402d6..dcc955d 100644 --- a/src/app/WardrobePage/ItemsPanel.js +++ b/src/app/WardrobePage/ItemsPanel.js @@ -32,6 +32,7 @@ import Item, { ItemListContainer, ItemListSkeleton } from "./Item"; import { BiRename } from "react-icons/bi"; import { IoCloudUploadOutline } from "react-icons/io5"; import { MdMoreVert } from "react-icons/md"; +import { buildOutfitUrl } from "./useOutfitState"; /** * ItemsPanel shows the items in the current outfit, and lets the user toggle @@ -359,6 +360,8 @@ function OutfitSavingIndicator({ outfitSaving }) { * It also contains the outfit menu, for saving etc. */ function OutfitHeading({ outfitState, outfitSaving, dispatchToOutfit }) { + const outfitCopyUrl = buildOutfitUrl(outfitState, { withoutOutfitId: true }); + return ( // The Editable wraps everything, including the menu, because the menu has // a Rename option. @@ -400,8 +403,13 @@ function OutfitHeading({ outfitState, outfitSaving, dispatchToOutfit }) { {outfitState.id && ( - } isDisabled> - Edit a copy (Coming soon) + } + as="a" + href={outfitCopyUrl} + target="_blank" + > + Edit a copy )}