diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/components/Column.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/components/Column.tsx index 71962c3..da1e23d 100644 --- a/src/app/(with-header-sidebar)/dashboard/[id]/components/Column.tsx +++ b/src/app/(with-header-sidebar)/dashboard/[id]/components/Column.tsx @@ -60,7 +60,7 @@ function Column({ }, [items]); const handleCreateTask = () => { - openModal(); + openModal(); }; return ( diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.module.css b/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.module.css index 757a334..8ee1766 100644 --- a/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.module.css +++ b/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.module.css @@ -12,6 +12,31 @@ color: var(--black-100); } +.image.image { + width: 76px; + height: 76px; +} + +.input input { + width: 295px; + font-size: 14px; + font-weight: 400; + line-height: 24px; + padding: 13px 16px; +} + +.input textarea { + width: 295px; + font-size: 14px; + font-weight: 400; + line-height: 24px; + padding: 15px 16px; +} + +.input label { + font-weight: 500; +} + .footer { display: flex; align-items: center; @@ -37,6 +62,24 @@ padding: 32px; } + .input input { + width: 520px; + font-size: 16px; + line-height: 26px; + padding: 12px 16px; + } + + .input textarea { + width: 520px; + font-size: 16px; + line-height: 26px; + } + + .input label { + font-size: 18px; + line-height: 26px; + } + .footer { font-size: 16px; line-height: 26px; diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.tsx index 102689d..8aaf794 100644 --- a/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.tsx +++ b/src/app/(with-header-sidebar)/dashboard/[id]/components/CreateTaskModal.tsx @@ -2,43 +2,83 @@ import useModalStore from '@/store/modalStore'; import { useForm } from 'react-hook-form'; import Button from '@/components/Button'; import Input from '@/components/Input'; -import styles from './CreateTaskModal.module.css'; import SearchDropdown from './SearchDropdown'; import DatePicker from './DatePicker'; +import Textarea from '@/components/Textarea'; +import FileInput from '@/components/FileInput'; +import TagsInput from '@/components/TagsInput'; +import useMember from '../edit/_hooks/useMember'; +import useDashboardStore from '@/store/dashboardStore'; +import { ERROR_MESSAGES } from '@/constants/message'; +import { createCard } from '@/lib/cardService'; +import styles from './CreateTaskModal.module.css'; -export interface ManagerOption { - id: number; - name: string; +export interface TaskFormValues { + assigneeUserId: number; + image: File | null; + title: string; + description: string; + dueDate: string; + tags: string[]; } -export default function CreateTaskModal() { +export default function CreateTaskModal({ columnId }: { columnId: number }) { const { closeModal } = useModalStore(); const { register, handleSubmit, formState: { errors, isValid }, - } = useForm<{ email: string }>({ mode: 'onChange' }); - - const onSubmit = () => { - // closeModal(); - }; - - const options = [ - { id: 1, name: '김김김' }, - { id: 2, name: '이이이' }, - { id: 3, name: '최최최' }, - ]; + setValue, + } = useForm({ mode: 'onChange' }); + const dashboard = useDashboardStore((state) => state.dashboard); + const { members } = useMember(dashboard?.id.toString() || null, 10); - const handleSelect = (selected: ManagerOption) => { - console.log('선택된 담당자:', selected); + const onSubmit = async (data: TaskFormValues) => { + if (dashboard) { + const response = await createCard(data, columnId, dashboard.id); + closeModal(); + } }; return (

할일 생성

- - - + + +