Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat/#58] API import 정리 #116

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading