From 02328a4f06412dba8318dc113a995a28ef9a789e Mon Sep 17 00:00:00 2001 From: SWARVY Date: Wed, 14 Aug 2024 23:04:33 +0900 Subject: [PATCH] refactor(time): refactor period constants & type (#97) --- .../time/src/widgets/time-table/model/constants/period.ts | 3 +++ apps/time/src/widgets/time-table/types/period.ts | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/time/src/widgets/time-table/model/constants/period.ts b/apps/time/src/widgets/time-table/model/constants/period.ts index 4b0dbc27..ac924d11 100644 --- a/apps/time/src/widgets/time-table/model/constants/period.ts +++ b/apps/time/src/widgets/time-table/model/constants/period.ts @@ -147,9 +147,12 @@ const DAY_STATUS = { night: '야간', } as const; +const SPECIAL_PERIOD = ['이러닝', '교외수업', '사회봉사'] as const; + export { DAY_PERIOD, NIGHT_PERIOD, + SPECIAL_PERIOD, DAY_PERIOD_ARRAY, NIGHT_PERIOD_ARRAY, DAY_STATUS, diff --git a/apps/time/src/widgets/time-table/types/period.ts b/apps/time/src/widgets/time-table/types/period.ts index 3263a695..90a55610 100644 --- a/apps/time/src/widgets/time-table/types/period.ts +++ b/apps/time/src/widgets/time-table/types/period.ts @@ -1,7 +1,7 @@ -import { DAY_PERIOD, NIGHT_PERIOD } from '@/widgets/time-table'; +import { DAY_PERIOD, NIGHT_PERIOD, SPECIAL_PERIOD } from '@/widgets/time-table'; -type DayPeriod = keyof typeof DAY_PERIOD; +export type SpecialPeriod = (typeof SPECIAL_PERIOD)[number]; -type NightPeriod = keyof typeof NIGHT_PERIOD; +export type DayPeriod = keyof typeof DAY_PERIOD | SpecialPeriod; -export type { DayPeriod, NightPeriod }; +export type NightPeriod = keyof typeof NIGHT_PERIOD | SpecialPeriod;