diff --git a/src/components/PoseDetector.tsx b/src/components/PoseDetector.tsx index 944aba4..1f3ac05 100644 --- a/src/components/PoseDetector.tsx +++ b/src/components/PoseDetector.tsx @@ -3,6 +3,8 @@ import { duration } from "@/api/notification" import { poseType } from "@/api/pose" import { useCameraPermission } from "@/hooks/useCameraPermission" import { useGuidePopup } from "@/hooks/useGuidePopup" +import { useModals } from "@/hooks/useModals" +import useNotification from "@/hooks/useNotification" import { useSendPose } from "@/hooks/usePoseMutation" import usePushNotification from "@/hooks/usePushNotification" import { useCreateSnaphot } from "@/hooks/useSnapshotMutation" @@ -14,10 +16,10 @@ import { worker } from "@/utils/worker" import { useCallback, useEffect, useRef, useState } from "react" import { useLocation } from "react-router-dom" import Camera from "./Camera" +import { modals } from "./Modal/Modals" import Controls from "./Posture/Controls" import GuidePopupModal from "./Posture/GuidePopup/GuidePopupModal" import PostureMessage from "./Posture/PostureMessage" -import useNotification from "@/hooks/useNotification" const PoseDetector: React.FC = () => { const [isScriptLoaded, setIsScriptLoaded] = useState(false) @@ -31,7 +33,9 @@ const PoseDetector: React.FC = () => { const { showNotification, hasPermission: hasNotiPermisson } = usePushNotification() - const { isPopupOpen, handleClosePopup, openPopup } = useGuidePopup() + const { isPopupOpen, handleClosePopup } = useGuidePopup() + + const { openModal, isModalOpen } = useModals() const modelRef = useRef(null) const snapRef = useRef(null) @@ -55,7 +59,6 @@ const PoseDetector: React.FC = () => { // const userNoti = useNotificationStore((state) => state.notification) const { notification } = useNotification() - const { hasPermission } = useCameraPermission() const location = useLocation() // 페이지 이동 감지 @@ -325,12 +328,14 @@ const PoseDetector: React.FC = () => { // 팝업 열기 const handleShowPopup = (): void => { - openPopup() + // openPopup() + openModal(modals.postureGuideModal, {}) } useEffect(() => { console.log(notification) }, [notification]) + return ( <> {isScriptError ? ( @@ -342,7 +347,7 @@ const PoseDetector: React.FC = () => { {isModelLoaded && ( <> - {!isPopupOpen && ( + {!isPopupOpen && !isModalOpen && ( { )} )} - {isPopupOpen && } + {!isSnapShotSaved && isPopupOpen && } )} diff --git a/src/components/Posture/PostrueCrew.tsx b/src/components/Posture/PostrueCrew.tsx index fd6fd04..f48e3cd 100644 --- a/src/components/Posture/PostrueCrew.tsx +++ b/src/components/Posture/PostrueCrew.tsx @@ -181,8 +181,6 @@ export default function PostrueCrew(props: PostureCrewProps): ReactElement { resetSnapShot() } - console.log("notification: ", notification) - return (