Skip to content

Commit

Permalink
[Hotfix] 스터디 커리큘럼 12주로 연장, 스터디 신청 기간 자유롭게 선택 가능하도록 수정 (#123)
Browse files Browse the repository at this point in the history
* fix: 스터디 신청 기간 및 스터디 커리큘럼 변경

* fix: 코드리뷰 반영
  • Loading branch information
eugene028 authored Sep 4, 2024
1 parent cdc1612 commit a6ebbc1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@ const StudyApplyDatePick = () => {
setValue("applicationEndDate", endDateString, { shouldValidate: true });
};

const disableDateList = [
{
from: new Date(0),
to: yesterday,
},
...(watch("startDate")
? [
{
from: studyStartDate,
to: studyStartDateYearLater,
},
]
: []),
];
return (
<Flex direction="column" gap="xs" position="relative" width={358}>
<Text color="sub" typo="label2">
Expand Down Expand Up @@ -89,9 +75,12 @@ const StudyApplyDatePick = () => {
{isOpen && (
<div ref={datepickerRef}>
<DayPicker
disabled={disableDateList}
mode="range"
weekStartsOn={1}
disabled={{
from: new Date(0),
to: yesterday,
}}
selected={{
from: formatStringToDate(studyDate.fromValue),
to: formatStringToDate(studyDate.toValue),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Flex } from "@styled-system/jsx";
import { Text } from "@wow-class/ui";
import { studyCurriculumList } from "constants/studyCurriculum";
import { Controller, useFormContext } from "react-hook-form";
import DropDown from "wowds-ui/DropDown";
import DropDownOption from "wowds-ui/DropDownOption";
Expand All @@ -21,16 +22,9 @@ const StudyCourseSelect = () => {
field.onChange(Number(selectedValue));
}}
>
<DropDownOption text="1주" value="1" />
<DropDownOption text="2주" value="2" />
<DropDownOption text="3주" value="3" />
<DropDownOption text="4주" value="4" />
<DropDownOption text="5주" value="5" />
<DropDownOption text="6주" value="6" />
<DropDownOption text="7주" value="7" />
<DropDownOption text="8주" value="8" />
<DropDownOption text="9주" value="9" />
<DropDownOption text="10주" value="10" />
{studyCurriculumList.map(({ text, value }) => (
<DropDownOption text={text} value={value} />
))}
</DropDown>
)}
rules={{
Expand Down
Empty file removed apps/admin/constants/date.ts
Empty file.
4 changes: 4 additions & 0 deletions apps/admin/constants/studyCurriculum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const studyCurriculumList = Array.from({ length: 12 }, (_, index) => {
const week = index + 1;
return { text: `${week}주`, value: `${week}` };
});

0 comments on commit a6ebbc1

Please sign in to comment.