Skip to content

Commit a911744

Browse files
authored
Merge pull request #252 from projects200/feature/exercise-ui-refactor
(#246) 운동기록페이지 운동시간(시작시간, 종료시간)UI 리팩토링
2 parents 8ffca91 + 63b214f commit a911744

14 files changed

Lines changed: 561 additions & 356 deletions

File tree

src/app/(main)/exercise/_components/exerciseForm/dateTimePicker.module.css

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/app/(main)/exercise/_components/exerciseForm/dateTimePicker.tsx

Lines changed: 0 additions & 173 deletions
This file was deleted.

src/app/(main)/exercise/_components/exerciseForm/exerciseForm.module.css

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,4 @@
1313
.button {
1414
box-shadow: 0 4px 8px rgba(0, 0, 0, 25%);
1515
}
16-
.score-description {
17-
display: flex;
18-
align-items: center;
19-
gap: 2px;
20-
margin-top: 4px;
21-
}
22-
.warning-icon {
23-
margin-top: 2px;
24-
width: 16px;
25-
height: 16px;
26-
color: var(--color-gray-200);
27-
}
28-
.description {
29-
color: var(--color-gray-200);
30-
}
16+

src/app/(main)/exercise/_components/exerciseForm/exerciseForm.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ import {
1111
ExerciseRecordReq,
1212
} from '@/types/exercise'
1313
import { useReadExerciseScore } from '@/hooks/api/useScoreApi'
14-
import WarningIcon from '@/assets/icon_warning.svg'
15-
import Typography from '@/components/ui/typography'
1614

17-
import DateTimePicker from './dateTimePicker'
15+
import TimeField from './timeField'
1816
import InputField from './inputField'
1917
import TextareaField from './textareaField'
2018
import ImageUploader from './imageUploader'
@@ -198,7 +196,7 @@ const ExerciseForm = forwardRef<ExerciseFormHandle, Props>(
198196
<form.Field name="endedAt">
199197
{(endedAtField) => (
200198
<div className={styles['form-field']}>
201-
<DateTimePicker
199+
<TimeField
202200
label="운동 시간 *"
203201
startedAt={startedAtField.state.value}
204202
endedAt={endedAtField.state.value}
@@ -208,19 +206,8 @@ const ExerciseForm = forwardRef<ExerciseFormHandle, Props>(
208206
onEndedAtChange={(value) =>
209207
endedAtField.handleChange(value)
210208
}
209+
description={scoreDescription}
211210
/>
212-
{scoreDescription && (
213-
<div className={styles['score-description']}>
214-
<WarningIcon className={styles['warning-icon']} />
215-
<Typography
216-
as="span"
217-
variant="content-small"
218-
className={styles['description']}
219-
>
220-
{scoreDescription}
221-
</Typography>
222-
</div>
223-
)}
224211
</div>
225212
)}
226213
</form.Field>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
.container {
2+
width: 100%;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
.score-description {
8+
display: flex;
9+
align-items: center;
10+
gap: 2px;
11+
margin-top: 4px;
12+
}
13+
.warning-icon {
14+
margin-top: 2px;
15+
width: 16px;
16+
height: 16px;
17+
color: var(--color-gray-200);
18+
}
19+
.description {
20+
color: var(--color-gray-200);
21+
}
22+
23+
.display {
24+
display: flex;
25+
align-items: center;
26+
justify-content: space-between;
27+
gap: 8px;
28+
width: 100%;
29+
margin: 18px 0;
30+
}
31+
32+
.time-container {
33+
flex: 1;
34+
display: flex;
35+
flex-direction: column;
36+
align-items: center;
37+
gap: 8px;
38+
}
39+
40+
.date-button,
41+
.time-button {
42+
padding: 6px 12px;
43+
border-radius: 20px;
44+
}
45+
46+
.active {
47+
background-color: var(--color-white-100);
48+
}
49+
50+
.arrow {
51+
width: 16px;
52+
height: 16px;
53+
flex-shrink: 0;
54+
color: var(--color-black);
55+
}
56+
57+
.expanded-container {
58+
border-top: solid 1px var(--color-gray-300);
59+
border-bottom: solid 1px var(--color-gray-300);
60+
}
61+
62+
.calendar-wrapper {
63+
padding-bottom: 10px;
64+
}
65+
66+
.time-picker-container {
67+
display: flex;
68+
align-items: center;
69+
justify-content: center;
70+
padding: 50px 0;
71+
gap: 12px;
72+
}
73+
74+
.clock-icon {
75+
font-size: 35px;
76+
margin-right: 10px;
77+
flex-shrink: 0;
78+
}
79+
80+
.input {
81+
width: 60px;
82+
font-size: 40px;
83+
text-align: center;
84+
border: none;
85+
outline: none;
86+
}
87+
88+
.input::-webkit-outer-spin-button,
89+
.input::-webkit-inner-spin-button {
90+
-webkit-appearance: none;
91+
margin: 0;
92+
}
93+
94+
.picker-confirm-buttom {
95+
margin-left: 16px;
96+
width: 62px;
97+
height: 34px;
98+
background-color: var(--color-green);
99+
color: var(--color-white-300);
100+
border-radius: 8px;
101+
flex-shrink: 0;
102+
}

0 commit comments

Comments
 (0)