Skip to content

Commit

Permalink
fix: 스터디 신청 기간 및 스터디 커리큘럼 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 committed Sep 4, 2024
1 parent cdc1612 commit 5e0a648
Show file tree
Hide file tree
Showing 4 changed files with 22 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.
14 changes: 14 additions & 0 deletions apps/admin/constants/studyCurriculum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const studyCurriculumList: Record<string, string>[] = [
{ text: "1주", value: "1" },
{ text: "2주", value: "2" },
{ text: "3주", value: "3" },
{ text: "4주", value: "4" },
{ text: "5주", value: "5" },
{ text: "6주", value: "6" },
{ text: "7주", value: "7" },
{ text: "8주", value: "8" },
{ text: "9주", value: "9" },
{ text: "10주", value: "10" },
{ text: "11주", value: "11" },
{ text: "12주", value: "12" },
];

0 comments on commit 5e0a648

Please sign in to comment.