From 5959aa12817a8ccfde677b32a46ffc9897c234d7 Mon Sep 17 00:00:00 2001 From: Lorenzo Croce Date: Sun, 28 Sep 2025 17:30:49 +0200 Subject: [PATCH 1/6] feat: popup also in kanvas page Signed-off-by: Lorenzo Croce --- src/components/Corner-popup/index.js | 14 ++++++++------ src/pages/index.js | 2 +- src/sections/Kanvas/index.js | 4 +++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Corner-popup/index.js b/src/components/Corner-popup/index.js index 0a77b25560b5c..1eb2db95a32eb 100644 --- a/src/components/Corner-popup/index.js +++ b/src/components/Corner-popup/index.js @@ -4,17 +4,19 @@ import { ReactComponent as CloseIcon } from "./closeIcon.svg"; import popupImageSmall from "./power-of-meshery-small.webp"; import CornerPopupWrapper from "./popup.style"; -const CornerPopup = () => { +const CornerPopup = ({ storageKey = "showPopup" }) => { const [showPopup, setShowPopup] = useState(false); useEffect(() => { - if (!localStorage.getItem("showPopup")) { + if (!localStorage.getItem(storageKey)) { setTimeout(() => { setShowPopup(true); + localStorage.setItem(storageKey, true); }, 8000); - localStorage.setItem("showPopup", true); - } else setShowPopup(false); - },[]); + } else { + setShowPopup(false); + } + }, [storageKey]); return ( showPopup && @@ -26,7 +28,7 @@ const CornerPopup = () => { - + popup image