diff --git a/src/apis/httpClient/httpClient.ts b/src/apis/httpClient/httpClient.ts index 827e7c57..1bd693af 100644 --- a/src/apis/httpClient/httpClient.ts +++ b/src/apis/httpClient/httpClient.ts @@ -171,4 +171,5 @@ export default { like: new HttpClient("api/likes/update", axiosConfig), image: new HttpClient("api/image/save", axiosConfig), meal: new HttpClient("api/meal", axiosConfig), + calender: new HttpClient("api/calender", axiosConfig), }; diff --git a/src/components/common/Modal/PlanAddModal/index.tsx b/src/components/common/Modal/PlanAddModal/index.tsx new file mode 100644 index 00000000..33e44ff0 --- /dev/null +++ b/src/components/common/Modal/PlanAddModal/index.tsx @@ -0,0 +1,121 @@ +import { XIcon } from "@/assets/icons"; +import { Column } from "@/components/Flex"; +import { Button, Input, Select } from "@/components/atoms"; +import useModal from "@/hooks/useModal"; +import useUser from "@/hooks/useUser"; +import { useAddCalenderPlanMutation } from "@/page/calender/services/mutation.service"; +import { color, flex, font } from "@/styles"; +import React from "react"; +import styled from "styled-components"; + +interface IPlanAddModalProps { + date: string; +} + +const PlanAddModal = ({ date }: IPlanAddModalProps) => { + const { closeModal } = useModal(); + const { mutate } = useAddCalenderPlanMutation(); + const { user } = useUser(); + const [planType, setPlanType] = React.useState("CLASS"); + const [title, setTitle] = React.useState(""); + const textareaRef = React.useRef(null); + + const handleAddButtonClick = () => { + mutate({ + title, + priority: 0, + date, + color: "#000", + type: planType, + grade: user.grade, + classNumber: user.classNum, + }); + }; + + React.useEffect(() => { + if (textareaRef.current) textareaRef.current.focus(); + }, []); + + return ( + +
+ + + + +
+ + setTitle(e.target.value)} + value={title} + /> + + 일정 분류 +