Skip to content

Commit 5d7ffa4

Browse files
committed
refactor: 날짜 선택 컴포넌트 코드 개선
1 parent 5e2b5bc commit 5d7ffa4

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

src/page/todo/myTodo/component/DatePicker/DatePicker.css.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,15 @@ export const iconButton = style({
3535
justifyContent: 'center',
3636
width: '2.8rem',
3737
height: '2.8rem',
38-
aspectRatio: '1/1',
3938
background: 'none',
4039
border: 'none',
4140
padding: 0,
4241
cursor: 'pointer',
4342
});
4443

45-
export const yesterdayIcon = style({
44+
export const iconBase = style({
4645
width: '2.8rem',
4746
height: '2.8rem',
48-
aspectRatio: '1/1',
49-
});
50-
51-
export const tomorrowIcon = style({
52-
width: '2.8rem',
53-
height: '2.8rem',
54-
aspectRatio: '1/1',
5547
});
5648

5749
export const iconActive = style({

src/page/todo/myTodo/component/DatePicker/DatePicker.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import {
33
datePickerContent,
44
dateText,
55
iconButton,
6-
yesterdayIcon,
7-
tomorrowIcon,
6+
iconBase,
87
iconActive,
98
iconInactive,
109
} from './DatePicker.css';
@@ -52,11 +51,11 @@ const DatePicker = ({
5251
<button
5352
className={iconButton}
5453
onClick={handleYesterdayClick}
55-
aria-label=" 어제 날짜"
54+
aria-label="어제 날짜"
5655
disabled={!hasPrev}
5756
type="button"
5857
>
59-
<IcYesterday className={`${yesterdayIcon} ${hasPrev ? iconActive : iconInactive}`} />
58+
<IcYesterday className={`${iconBase} ${hasPrev ? iconActive : iconInactive}`} />
6059
</button>
6160
<span className={dateText}>{formatDateDot(currentDate)}</span>
6261
<button
@@ -66,7 +65,7 @@ const DatePicker = ({
6665
disabled={!hasNext}
6766
type="button"
6867
>
69-
<IcTomorrow className={`${tomorrowIcon} ${hasNext ? iconActive : iconInactive}`} />
68+
<IcTomorrow className={`${iconBase} ${hasNext ? iconActive : iconInactive}`} />
7069
</button>
7170
</div>
7271
</div>

0 commit comments

Comments
 (0)