@@ -53,14 +57,14 @@ const MonitoringPage: React.FC = () => {
{/* 사이드바 */}
- {isSidebarOpen &&
}
+ {isSidebarOpen && !isPopupOpen &&
}
{/* 토글 버튼 */}
- {!isSidebarOpen && (
+ {!isSidebarOpen && !isPopupOpen && (
diff --git a/src/store/GuidePopupStore.ts b/src/store/GuidePopupStore.ts
new file mode 100644
index 0000000..d20c7bf
--- /dev/null
+++ b/src/store/GuidePopupStore.ts
@@ -0,0 +1,27 @@
+import { create } from "zustand"
+import { createJSONStorage, persist } from "zustand/middleware"
+
+interface PopupStore {
+ isPopupOpen: boolean
+ lastClosedDate: string | null
+ openPopup: () => void
+ closePopup: () => void
+ setLastClosedDate: (date: string) => void
+}
+
+// Zustand store 생성
+export const useGuidePopupStore = create(
+ persist
(
+ (set: any) => ({
+ isPopupOpen: false,
+ lastClosedDate: null,
+ openPopup: () => set({ isPopupOpen: true }),
+ closePopup: () => set({ isPopupOpen: false }),
+ setLastClosedDate: (date) => set({ lastClosedDate: date }),
+ }),
+ {
+ name: "popup-storage",
+ storage: createJSONStorage(() => localStorage),
+ }
+ )
+)
diff --git a/src/store/SnapshotStore.ts b/src/store/SnapshotStore.ts
index 07fcbc6..acee90d 100644
--- a/src/store/SnapshotStore.ts
+++ b/src/store/SnapshotStore.ts
@@ -3,15 +3,19 @@ import { create } from "zustand"
import { persist } from "zustand/middleware"
interface SnapshotState {
+ isSnapShotSaved: boolean
snapshot: keypoint[] | null
- setSnapshot: (snapshot: keypoint[] | null) => void
+ setSnapShot: (snapshot: keypoint[] | null) => void
+ resetSnapShot: () => void
}
export const useSnapshotStore = create(
persist(
(set) => ({
+ isSnapShotSaved: false,
snapshot: null,
- setSnapshot: (snapshot: keypoint[] | null) => set({ snapshot }),
+ setSnapShot: (snapshot: keypoint[] | null) => set({ snapshot, isSnapShotSaved: true }),
+ resetSnapShot: () => set({ snapshot: null, isSnapShotSaved: false }),
}),
{ name: "snapshotStorage" }
)