Skip to content

Commit 384518c

Browse files
authored
Merge pull request #116 from DDD-Community/feat/#58
[feat/#58] API import 정리
2 parents fd8960a + 5502bdd commit 384518c

File tree

10 files changed

+17
-15
lines changed

10 files changed

+17
-15
lines changed

src/api/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ export * from "./auth"
22
export * from "./snapshot"
33
export * from "./group"
44
export * from "./report"
5+
export * from "./notification"
6+
export * from "./pose"
7+
export * from "./analysis"

src/components/PoseDetector.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { position } from "@/api"
2-
import { duration } from "@/api/notification"
3-
import { poseType } from "@/api/pose"
1+
import { position, duration, poseType } from "@/api"
42
import { useCameraPermission } from "@/hooks/useCameraPermission"
53
import { useGuidePopup } from "@/hooks/useGuidePopup"
64
import { useModals } from "@/hooks/useModals"
@@ -59,7 +57,7 @@ const PoseDetector: React.FC = () => {
5957
const { isSnapShotSaved, snapshot, setSnapShot, isInitialSnapShotExist } = useSnapShotStore()
6058
const createSnapMutation = useCreateSnaphot()
6159
const sendPoseMutation = useSendPose()
62-
const { isPopupOpen, handleClosePopup } = useGuidePopup()
60+
const { isPopupOpen, handleClosePopup } = useGuidePopup(isClosedInitialGuidePopup)
6361

6462
// const userNoti = useNotificationStore((state) => state.notification)
6563
const { notification } = useNotification()

src/components/Posture/PostrueCrew.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { duration, notification } from "@/api/notification"
1+
import { duration, notification } from "@/api"
22
import EmptyGroupImage from "@/assets/images/crew-empty.png"
33
import RoutePath from "@/constants/routes.json"
44
import { useModals } from "@/hooks/useModals"

src/hooks/useDashBoard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getTodayPoseAnalysis, getTotalPoseAnalysis } from "@/api/analysis"
1+
import { getTodayPoseAnalysis, getTotalPoseAnalysis } from "@/api"
22
import { useQueries } from "@tanstack/react-query"
33
import dayjs from "dayjs"
44
import { DateValueType } from "react-tailwindcss-datepicker"

src/hooks/useGuidePopup.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useGuidePopupStore } from "@/store/GuidePopupStore"
22
import { useEffect } from "react"
33

4-
export const useGuidePopup = () => {
4+
export const useGuidePopup = (isClosedInitialGuidePopup: boolean = false) => {
55
const { isPopupOpen, lastClosedDate, openPopup, closePopup, setLastClosedDate } = useGuidePopupStore()
66

77
useEffect(() => {
@@ -11,9 +11,10 @@ export const useGuidePopup = () => {
1111
openPopup()
1212
}
1313
}
14-
15-
checkPopupDate()
16-
}, [lastClosedDate, openPopup])
14+
if (!isClosedInitialGuidePopup) {
15+
checkPopupDate()
16+
}
17+
}, [lastClosedDate, openPopup, isClosedInitialGuidePopup])
1718

1819
const handleClosePopup = () => {
1920
closePopup()

src/hooks/useNotiMutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getNotification, registerNotification, notification } from "@/api/notification"
1+
import { getNotification, registerNotification, notification } from "@/api"
22
import { useMutation, UseMutationResult, useQuery, UseQueryResult } from "@tanstack/react-query"
33

44
export const useGetNoti = (): UseQueryResult<{ data: notification }, Error> => {

src/hooks/useNotification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getNotification } from "@/api/notification"
1+
import { getNotification } from "@/api"
22
import { useNotificationStore } from "@/store/NotificationStore"
33
import { useEffect, useState } from "react"
44

src/hooks/usePoseMutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { poseReq, poseRes, sendPose } from "@/api/pose"
1+
import { poseReq, poseRes, sendPose } from "@/api"
22
import { useMutation, UseMutationResult } from "@tanstack/react-query"
33

44
export const useSendPose = (): UseMutationResult<poseRes, unknown, poseReq, unknown> => {

src/pages/AnalysisDashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { poseType } from "@/api/pose"
1+
import { poseType } from "@/api"
22
import { usePoseAnalysis } from "@/hooks/useDashBoard"
33
import { ChevronLeft, ChevronRight } from "lucide-react"
44
import { useEffect, useRef, useState } from "react"

src/store/NotificationStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { notification } from "@/api/notification"
1+
import { notification } from "@/api"
22
import { create } from "zustand"
33

44
interface NotificationState {

0 commit comments

Comments
 (0)