Skip to content

Commit

Permalink
Merge pull request #116 from DDD-Community/feat/#58
Browse files Browse the repository at this point in the history
[feat/#58] API import 정리
  • Loading branch information
G-hoon authored Sep 29, 2024
2 parents fd8960a + 5502bdd commit 384518c
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ export * from "./auth"
export * from "./snapshot"
export * from "./group"
export * from "./report"
export * from "./notification"
export * from "./pose"
export * from "./analysis"
6 changes: 2 additions & 4 deletions src/components/PoseDetector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { position } from "@/api"
import { duration } from "@/api/notification"
import { poseType } from "@/api/pose"
import { position, duration, poseType } from "@/api"
import { useCameraPermission } from "@/hooks/useCameraPermission"
import { useGuidePopup } from "@/hooks/useGuidePopup"
import { useModals } from "@/hooks/useModals"
Expand Down Expand Up @@ -59,7 +57,7 @@ const PoseDetector: React.FC = () => {
const { isSnapShotSaved, snapshot, setSnapShot, isInitialSnapShotExist } = useSnapShotStore()
const createSnapMutation = useCreateSnaphot()
const sendPoseMutation = useSendPose()
const { isPopupOpen, handleClosePopup } = useGuidePopup()
const { isPopupOpen, handleClosePopup } = useGuidePopup(isClosedInitialGuidePopup)

// const userNoti = useNotificationStore((state) => state.notification)
const { notification } = useNotification()
Expand Down
2 changes: 1 addition & 1 deletion src/components/Posture/PostrueCrew.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { duration, notification } from "@/api/notification"
import { duration, notification } from "@/api"
import EmptyGroupImage from "@/assets/images/crew-empty.png"
import RoutePath from "@/constants/routes.json"
import { useModals } from "@/hooks/useModals"
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDashBoard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getTodayPoseAnalysis, getTotalPoseAnalysis } from "@/api/analysis"
import { getTodayPoseAnalysis, getTotalPoseAnalysis } from "@/api"
import { useQueries } from "@tanstack/react-query"
import dayjs from "dayjs"
import { DateValueType } from "react-tailwindcss-datepicker"
Expand Down
9 changes: 5 additions & 4 deletions src/hooks/useGuidePopup.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useGuidePopupStore } from "@/store/GuidePopupStore"
import { useEffect } from "react"

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

useEffect(() => {
Expand All @@ -11,9 +11,10 @@ export const useGuidePopup = () => {
openPopup()
}
}

checkPopupDate()
}, [lastClosedDate, openPopup])
if (!isClosedInitialGuidePopup) {
checkPopupDate()
}
}, [lastClosedDate, openPopup, isClosedInitialGuidePopup])

const handleClosePopup = () => {
closePopup()
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useNotiMutation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getNotification, registerNotification, notification } from "@/api/notification"
import { getNotification, registerNotification, notification } from "@/api"
import { useMutation, UseMutationResult, useQuery, UseQueryResult } from "@tanstack/react-query"

export const useGetNoti = (): UseQueryResult<{ data: notification }, Error> => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useNotification.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getNotification } from "@/api/notification"
import { getNotification } from "@/api"
import { useNotificationStore } from "@/store/NotificationStore"
import { useEffect, useState } from "react"

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/usePoseMutation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { poseReq, poseRes, sendPose } from "@/api/pose"
import { poseReq, poseRes, sendPose } from "@/api"
import { useMutation, UseMutationResult } from "@tanstack/react-query"

export const useSendPose = (): UseMutationResult<poseRes, unknown, poseReq, unknown> => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AnalysisDashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { poseType } from "@/api/pose"
import { poseType } from "@/api"
import { usePoseAnalysis } from "@/hooks/useDashBoard"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { useEffect, useRef, useState } from "react"
Expand Down
2 changes: 1 addition & 1 deletion src/store/NotificationStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { notification } from "@/api/notification"
import { notification } from "@/api"
import { create } from "zustand"

interface NotificationState {
Expand Down

0 comments on commit 384518c

Please sign in to comment.