From 1da45c528d816f8acedc2ad83e310217a74fb2f7 Mon Sep 17 00:00:00 2001 From: frontend perkafean <165241731+frontendperkafean@users.noreply.github.com> Date: Tue, 8 Oct 2024 05:43:06 +0000 Subject: [PATCH] ok --- src/components/Footer.module.css | 2 +- src/components/Header.js | 6 +++--- src/components/ItemLister.js | 9 ++++++++- src/components/ItemType.js | 24 +++++++++++++----------- src/components/ItemType.module.css | 1 + src/components/ItemTypeLister.css | 10 ++++++++++ src/components/ItemTypeLister.js | 29 +++++++++++++++++++---------- src/pages/CafePage.js | 4 ++++ 8 files changed, 59 insertions(+), 26 deletions(-) diff --git a/src/components/Footer.module.css b/src/components/Footer.module.css index f8652ce..d4e17a6 100644 --- a/src/components/Footer.module.css +++ b/src/components/Footer.module.css @@ -68,7 +68,7 @@ align-items: center; justify-content: center; transition: height 0.3s ease; - z-index: 200; + z-index: 197; } .scanMeja.stretched { diff --git a/src/components/Header.js b/src/components/Header.js index ac2c725..3f793eb 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -30,7 +30,7 @@ const ProfileName = styled.h2` font-weight: 500; font-style: normal; font-size: 30px; - z-index: 11; + z-index: 199; overflow: hidden; white-space: nowrap; animation: ${(props) => { @@ -92,7 +92,7 @@ const ProfileImage = styled.img` height: 60px; border-radius: 50%; cursor: pointer; - z-index: 12; + z-index: 199; animation: ${(props) => { if (props.animate === "grow") return g; if (props.animate === "shrink") return s; @@ -165,7 +165,7 @@ const Rectangle = styled.div` width: 200px; max-height: 87vh; /* or another appropriate value */ background-color: white; - z-index: 10; + z-index: 198; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); animation: ${(props) => (props.animate === "grow" ? grow : shrink)} 0.5s forwards; diff --git a/src/components/ItemLister.js b/src/components/ItemLister.js index e121395..e371519 100644 --- a/src/components/ItemLister.js +++ b/src/components/ItemLister.js @@ -28,6 +28,8 @@ const ItemLister = ({ raw, handleCreateItem, handleUpdateItem, + beingEditedType, + setBeingEditedType, }) => { const [items, setItems] = useState( itemList.map((item) => ({ @@ -125,10 +127,12 @@ const ItemLister = ({ const toggleAddNewItem = () => { setIsAddingNewItem((prev) => !prev); setOnEditItem(0); + setBeingEditedType(itemTypeId); }; const editItem = (itemId) => { setIsAddingNewItem(false); setOnEditItem(itemId); + setBeingEditedType(itemTypeId); }; const handleChange = async (itemId) => { // Find the item in the current items array @@ -297,7 +301,10 @@ const ItemLister = ({ onPlusClick={() => handlePlusClick(item.itemId)} onNegativeClick={() => handleNegativeClick(item.itemId)} onRemoveClick={() => handleRemoveClick(item.itemId)} - isBeingEdit={onEditItem == item.itemId} + isBeingEdit={ + onEditItem == item.itemId && + beingEditedType == itemTypeId + } isAvailable={item.availability} handleUpdateItem={(name, price, image) => handleUpdateItem(item.itemId, name, price, image) diff --git a/src/components/ItemType.js b/src/components/ItemType.js index d0d3241..37ad127 100644 --- a/src/components/ItemType.js +++ b/src/components/ItemType.js @@ -91,17 +91,19 @@ export default function ItemType({ )} - + {(rectangular || !blank) && ( + + )} {/* {blank && (