Skip to content

Commit 9f8796b

Browse files
committed
feat: 반복 일정 아이콘 구현
1 parent d52014d commit 9f8796b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/App.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ function App() {
208208
>
209209
<Stack direction="row" spacing={1} alignItems="center">
210210
{isNotified && <Notifications fontSize="small" />}
211+
{event.repeat.type !== 'none' && (
212+
<Autorenew fontSize="small" aria-label="반복 일정 아이콘" />
213+
)}
211214
<Typography
212215
variant="caption"
213216
noWrap
@@ -295,6 +298,9 @@ function App() {
295298
>
296299
<Stack direction="row" spacing={1} alignItems="center">
297300
{isNotified && <Notifications fontSize="small" />}
301+
{event.repeat.type !== 'none' && (
302+
<Autorenew fontSize="small" aria-label="반복 일정 아이콘" />
303+
)}
298304
<Typography
299305
variant="caption"
300306
noWrap
@@ -421,7 +427,15 @@ function App() {
421427
control={
422428
<Checkbox
423429
checked={isRepeating}
424-
onChange={(e) => setIsRepeating(e.target.checked)}
430+
onChange={(e) => {
431+
const checked = e.target.checked;
432+
setIsRepeating(checked);
433+
if (!checked) {
434+
setRepeatType('none');
435+
setRepeatInterval(1);
436+
setRepeatEndDate('');
437+
}
438+
}}
425439
/>
426440
}
427441
label="반복 일정"
@@ -554,9 +568,6 @@ function App() {
554568
<Stack>
555569
<Stack direction="row" spacing={1} alignItems="center">
556570
{notifiedEvents.includes(event.id) && <Notifications color="error" />}
557-
{event.repeat.type !== 'none' && (
558-
<Autorenew fontSize="small" aria-label="반복 일정 아이콘" />
559-
)}
560571
<Typography
561572
fontWeight={notifiedEvents.includes(event.id) ? 'bold' : 'normal'}
562573
color={notifiedEvents.includes(event.id) ? 'error' : 'inherit'}

src/utils/repeat/actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
getNextWeeklyOccurrence,
1414
getNextYearlyOccurrence,
1515
addMonthsUntilHasDay,
16+
getNextMonthlyOccurrence,
1617
} from './helpers';
1718
import type { Event } from '../../types';
1819

0 commit comments

Comments
 (0)