diff --git a/src/components/PoseDetector.tsx b/src/components/PoseDetector.tsx index 25e8ab0..da31725 100644 --- a/src/components/PoseDetector.tsx +++ b/src/components/PoseDetector.tsx @@ -7,7 +7,7 @@ import { useSendPose } from "@/hooks/usePoseMutation" import usePushNotification from "@/hooks/usePushNotification" import { useCreateSnaphot } from "@/hooks/useSnapshotMutation" import { useNotificationStore } from "@/store/NotificationStore" -import { useSnapshotStore } from "@/store/SnapShotStore" +import { useSnapShotStore } from "@/store/SnapshotStore" import type { pose } from "@/utils/detector" import { detectHandOnChin, detectSlope, detectTailboneSit, detectTextNeck } from "@/utils/detector" import { drawPose } from "@/utils/drawer" @@ -49,7 +49,7 @@ const PoseDetector: React.FC = () => { const canvasRef = useRef(null) - const { isSnapShotSaved, snapshot, setSnapShot } = useSnapshotStore() + const { isSnapShotSaved, snapshot, setSnapShot } = useSnapShotStore() const createSnapMutation = useCreateSnaphot() const sendPoseMutation = useSendPose() diff --git a/src/components/Posture/PostrueCrew.tsx b/src/components/Posture/PostrueCrew.tsx index e0e364c..eded8ad 100644 --- a/src/components/Posture/PostrueCrew.tsx +++ b/src/components/Posture/PostrueCrew.tsx @@ -12,7 +12,7 @@ import RankingGuideToolTip from "@assets/images/ranking-guide.png" import SelectBox from "@components/SelectBox" import { ReactElement, useCallback, useEffect, useRef, useState } from "react" import { modals } from "../Modal/Modals" -import { useSnapshotStore } from "@/store/SnapShotStore" +import { useSnapShotStore } from "@/store/SnapshotStore" import { useCreateSnaphot } from "@/hooks/useSnapshotMutation" interface IPostureCrew { @@ -47,7 +47,7 @@ const UPDATE_INTERVAL = 1000 // 1초마다 상태 업데이트 export default function PostrueCrew(props: PostureCrewProps): ReactElement { const { toggleSidebar } = props const accessToken = useAuthStore((state) => state.accessToken) - const { resetSnapShot } = useSnapshotStore() + const { resetSnapShot } = useSnapShotStore() const { openModal } = useModals() const createSnapMutation = useCreateSnaphot() const [crews, setCrews] = useState([]) diff --git a/src/components/SideNav.tsx b/src/components/SideNav.tsx index cbf9d98..d6f25de 100644 --- a/src/components/SideNav.tsx +++ b/src/components/SideNav.tsx @@ -4,7 +4,7 @@ import AnalysisIcon from "@assets/icons/side-nav-analysis-icon.svg?react" import CrewIcon from "@assets/icons/side-nav-crew-icon.svg?react" import MonitoringIcon from "@assets/icons/side-nav-monitor-icon.svg?react" import { Link, useLocation, useNavigate } from "react-router-dom" -import { useSnapshotStore } from "@/store/SnapShotStore" +import { useSnapShotStore } from "@/store/SnapshotStore" import { useMemo } from "react" import { clearAccessToken } from "@/api/axiosInstance" import { useNotificationStore } from "@/store/NotificationStore" @@ -35,7 +35,7 @@ export default function SideNav(): React.ReactElement { const logoutHandler = (): void => { const clearUser = useAuthStore.persist.clearStorage - const clearSnapshot = useSnapshotStore.persist.clearStorage + const clearSnapshot = useSnapShotStore.persist.clearStorage const clearNotification = useNotificationStore.persist.clearStorage clearUser() diff --git a/src/pages/AuthPage.tsx b/src/pages/AuthPage.tsx index 2b8e0b0..b77c71b 100644 --- a/src/pages/AuthPage.tsx +++ b/src/pages/AuthPage.tsx @@ -4,7 +4,7 @@ import Login from "@/components/Login" import { useOauth, useSignUp, useSignIn, useGetIsSignUp } from "@/hooks/useAuthMutation" import RoutePath from "@/constants/routes.json" import { useAuthStore } from "@/store/AuthStore" -import { useSnapshotStore } from "@/store/SnapShotStore" +import { useSnapShotStore } from "@/store/SnapshotStore" import { useGetRecentSnapshot } from "@/hooks/useSnapshotMutation" import { useGetNoti } from "@/hooks/useNotiMutation" import { useNotificationStore } from "@/store/NotificationStore" @@ -22,7 +22,7 @@ const AuthPage: React.FC = () => { const [isError, setIsError] = useState(false) const setUser = useAuthStore((state) => state.setUser) - const setSnap = useSnapshotStore((state) => state.setSnapShot) + const setSnap = useSnapShotStore((state) => state.setSnapShot) const setNoti = useNotificationStore((state) => state.setNotification) useEffect(() => { diff --git a/src/pages/MonitoringPage.tsx b/src/pages/MonitoringPage.tsx index 4265992..e7d8435 100644 --- a/src/pages/MonitoringPage.tsx +++ b/src/pages/MonitoringPage.tsx @@ -3,7 +3,7 @@ import PostrueCrew from "@/components/Posture/PostrueCrew" import GroupSideIcon from "@assets/icons/group-side-nav-button.svg?react" import React, { useEffect, useState } from "react" import { useGetRecentSnapshot } from "@/hooks/useSnapshotMutation" -import { useSnapshotStore } from "@/store/SnapShotStore" +import { useSnapShotStore } from "@/store/SnapshotStore" import usePushNotification from "@/hooks/usePushNotification" import { useGuidePopup } from "@/hooks/useGuidePopup" @@ -12,7 +12,7 @@ const MonitoringPage: React.FC = () => { const getRecentSnapMutation = useGetRecentSnapshot() const { isPopupOpen } = useGuidePopup() - const { snapshot, setSnapShot } = useSnapshotStore() + const { snapshot, setSnapShot } = useSnapShotStore() const [isSidebarOpen, setIsSidebarOpen] = useState(true) diff --git a/src/store/SnapshotStore.ts b/src/store/SnapshotStore.ts index acee90d..1a3984e 100644 --- a/src/store/SnapshotStore.ts +++ b/src/store/SnapshotStore.ts @@ -2,15 +2,15 @@ import { keypoint } from "@/utils" import { create } from "zustand" import { persist } from "zustand/middleware" -interface SnapshotState { +interface SnapShotState { isSnapShotSaved: boolean snapshot: keypoint[] | null setSnapShot: (snapshot: keypoint[] | null) => void resetSnapShot: () => void } -export const useSnapshotStore = create( - persist( +export const useSnapShotStore = create( + persist( (set) => ({ isSnapShotSaved: false, snapshot: null,