From b7af2d315c2ca800c154930794ef0b62135d6914 Mon Sep 17 00:00:00 2001 From: Mule129 Date: Tue, 6 Aug 2024 20:33:40 +0900 Subject: [PATCH] [Feat] #21 - add css and today score --- src/app/log/DietLog.tsx | 31 ++++++++++----- src/app/log/SleepLog.tsx | 32 ++++++++++----- src/app/log/WorkoutLog.tsx | 32 ++++++++++----- src/app/log/page.module.scss | 77 ++++++++++++++++++++++++++++++++++++ src/app/log/page.tsx | 38 ++++++++++++++++-- 5 files changed, 176 insertions(+), 34 deletions(-) create mode 100644 src/app/log/page.module.scss diff --git a/src/app/log/DietLog.tsx b/src/app/log/DietLog.tsx index 9ea6bb2..6824a8d 100644 --- a/src/app/log/DietLog.tsx +++ b/src/app/log/DietLog.tsx @@ -3,22 +3,33 @@ import { useDietOfDay } from "@/lib/firebase/api/dietAPI"; import Image from "next/image"; +import styles from './page.module.scss' +import { logInput } from "./page"; + export default function DietLog() { const { data, isLoading, isError } = useDietOfDay(new Date()); if (isLoading) return
Loading...
; if (isError) return
Error
; - if (!data) return
; + if (!data) return
활동을 추가해보세요!
; return ( -
-

식습관

- {data.map((diet) => ( -
-
{diet.name}
-
{diet.calorie}
- {diet.name} -
- ))} +
+
+
식습관
+ + + + +
+
+ {data.map((diet) => ( +
+
{diet.name}
+
{diet.calorie}
+ {diet.name} +
+ ))} +
); } diff --git a/src/app/log/SleepLog.tsx b/src/app/log/SleepLog.tsx index 2a5d306..f1acbdc 100644 --- a/src/app/log/SleepLog.tsx +++ b/src/app/log/SleepLog.tsx @@ -2,22 +2,34 @@ import { useSleepOfDay } from "@/lib/firebase/api/sleepAPI"; +import styles from './page.module.scss' +import { logInput } from "./page"; + + export default function SleepLog() { const { data, isLoading, isError } = useSleepOfDay(new Date()); if (isLoading) return
Loading...
; if (isError) return
Error
; - if (!data) return
; + if (!data) return
활동을 추가해보세요!
; return ( -
-

수면

- {data.map((sleep) => ( -
-
{sleep.label}
-
{sleep.sleepStart.toISOString()}
-
{sleep.sleepEnd.toISOString()}
-
- ))} +
+
+
수면습관
+ + + + +
+
+ {data.map((sleep) => ( +
+
{sleep.label}
+
{sleep.sleepStart.toISOString()}
+
{sleep.sleepEnd.toISOString()}
+
+ ))} +
); } diff --git a/src/app/log/WorkoutLog.tsx b/src/app/log/WorkoutLog.tsx index fa46207..0b280e3 100644 --- a/src/app/log/WorkoutLog.tsx +++ b/src/app/log/WorkoutLog.tsx @@ -2,22 +2,34 @@ import { useWorkoutOfDay } from "@/lib/firebase/api/workoutAPI"; +import styles from './page.module.scss' +import { logInput } from "./page"; + export default function WorkoutLog() { const { data, isLoading, isError } = useWorkoutOfDay(new Date()); if (isLoading) return
Loading...
; if (isError) return
Error
; - if (!data) return
; + if (!data) return
활동을 추가해보세요!
; return ( -
-

운동

- {data.map((workout) => ( -
-
{workout.exerciseName}
-
{workout.duration}
-
{workout.datetime.toISOString()}
-
- ))} +
+
+
운동
+ + + + +
+
+ {data.map((workout) => ( +
+
{workout.exerciseName}
+
{workout.duration}
+
{workout.datetime.toISOString()}
+
+ ))} +
+
); } diff --git a/src/app/log/page.module.scss b/src/app/log/page.module.scss new file mode 100644 index 0000000..e14fc6b --- /dev/null +++ b/src/app/log/page.module.scss @@ -0,0 +1,77 @@ +@use '../../lib/styles/palette' as *; + +.log_frame { + display: flex; + height: 100vh; + padding: 40px 20px; + flex-direction: column; + align-items: center; + gap: 40px; + flex-shrink: 0; + + .today_score_frame { + display: flex; + padding: 20px; + justify-content: space-between; + align-items: center; + align-self: stretch; + + border-radius: 20px; + background: $sub-color; + + .today_score_text { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + + .today_score_text_in { + color: $black-color; + font-weight: 600; + } + } + + .today_score { + color: $black-color; + font-size: 36px; + font-style: normal; + font-weight: 600; + line-height: normal; + } + } + +} + +.add_log_frame { + display: flex; + padding: 20px; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 20px; + align-self: stretch; + + border-radius: 20px; + background: $sub-color; + + .add_log_title { + display: flex; + justify-content: space-between; + align-items: center; + align-self: stretch; + + color: $black-color; + font-size: 20px; + } +} + +.log_input { + display: flex; + padding: 4px 8px; + justify-content: space-between; + align-items: center; + align-self: stretch; + + border-radius: 16px; + background: $main-color; +} \ No newline at end of file diff --git a/src/app/log/page.tsx b/src/app/log/page.tsx index e36b087..ca2eb08 100644 --- a/src/app/log/page.tsx +++ b/src/app/log/page.tsx @@ -1,14 +1,44 @@ +"use client" + import DietLog from "./DietLog"; import SleepLog from "./SleepLog"; import WorkoutLog from "./WorkoutLog"; +import styles from './page.module.scss' + +import Header from "../_common/header"; +import NavBar from "../_common/navBar"; +import { useState } from "react"; + + +export function logInput() { + console.log("log input select"); + return ( +
+ + 완료 +
+ ) +} + export default function LogPage() { + const [ score, setScore ] = useState(100); return (
-

Log

- - - +
+
+
+
+
오늘의 점수
+
오늘도 열심히 활동했어요!
+
+
{score}점
+
+ + + +
+
); }