-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
559ac1e
commit b2310ba
Showing
4 changed files
with
58 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useState } from "react"; | ||
import styles from "./page.module.scss"; | ||
import { usePersonalGoals } from "@/lib/firebase/api/personalGoalAPI"; | ||
|
||
export default function Score() { | ||
const [score, setScore] = useState(100); | ||
const { data, isLoading, isError } = usePersonalGoals(); | ||
|
||
// ///// | ||
// try { | ||
// const response_score = await axios.post( | ||
// 'https://castberry.kr:3650/api/open', { | ||
// "goal": {}, | ||
// "status": {}, | ||
// } | ||
// ); | ||
// setScore(JSON.parse(response_score.data).score); | ||
// } catch (error) { | ||
// console.error(error); | ||
// } | ||
///// | ||
|
||
return ( | ||
<div className={styles.today_score_frame}> | ||
<div className={styles.today_score_text}> | ||
<div className={styles.today_score_text_in}>오늘의 점수</div> | ||
<div>오늘도 열심히 활동했어요!</div> | ||
</div> | ||
<div className={styles.today_score}>{score}점</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { useMemo } from "react"; | ||
import { useDietOfDay } from "../firebase/api/dietAPI" | ||
import { useWorkoutOfDay } from "../firebase/api/workoutAPI"; | ||
|
||
export const useLogStatus = () => { | ||
const { data: diets, isLoading: dietIsLoading, isError: dietIsError } = useDietOfDay(new Date()); | ||
const { data: workouts, isLoading: workoutIsLoading, isError: workoutIsError } = useWorkoutOfDay(new Date()); | ||
const { data: sleeps, isLoading: sleepIsLoading, isError: sleepIsError } = useWorkoutOfDay(new Date()); | ||
|
||
const isRender = useMemo(() => { | ||
if (dietIsLoading || workoutIsLoading || sleepIsLoading) return false; | ||
if (dietIsError || workoutIsError || sleepIsError) return false; | ||
return true; | ||
}, [dietIsLoading, workoutIsLoading, sleepIsLoading, dietIsError, workoutIsError, sleepIsError]); | ||
} |