-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
84 deletions.
There are no files selected for viewing
25 changes: 0 additions & 25 deletions
25
src/entities/create-exhibition/ui/ImageInput/index.stories.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,57 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import { useForm } from 'react-hook-form'; | ||
import { SMSHeader } from '@/entities/SMS'; | ||
import { Button } from '@/shared/ui'; | ||
import TextArea from '@/shared/ui/TextArea'; | ||
|
||
interface FormData { | ||
title: string; | ||
content: string; | ||
} | ||
|
||
export default function Write() { | ||
const [title, setTitle] = useState<string>(''); | ||
const [content, setContent] = useState<string>(''); | ||
const { | ||
register, | ||
handleSubmit, | ||
formState: { isSubmitting }, | ||
} = useForm<FormData>(); | ||
|
||
const onSubmit = (data: FormData) => { | ||
console.log(data); | ||
}; | ||
|
||
return ( | ||
<div className="relative mx-auto flex w-full max-w-[792px] flex-1 flex-col pb-5"> | ||
<form | ||
onSubmit={handleSubmit(onSubmit)} | ||
className="relative mx-auto flex w-full max-w-[792px] flex-1 flex-col pb-5" | ||
> | ||
<div className="flex flex-1 flex-col gap-[62px]"> | ||
<SMSHeader /> | ||
<div className="space-y-[40px]"> | ||
<TextArea | ||
title="제목" | ||
placeholder="제목 입력" | ||
maxLength={30} | ||
text="text-h1" | ||
state={title} | ||
setState={setTitle} | ||
registration={register('title', { | ||
required: '제목을 입력해주세요.', | ||
})} | ||
row={1} | ||
/> | ||
<TextArea | ||
title="내용" | ||
placeholder="내용 입력" | ||
maxLength={1000} | ||
text="text-caption2" | ||
state={content} | ||
setState={setContent} | ||
registration={register('content', { | ||
required: '내용을 입력해주세요.', | ||
})} | ||
row={12} | ||
/> | ||
</div> | ||
<div className="w-full mobile:px-5"> | ||
<Button text="보내기" /> | ||
<Button disabled={isSubmitting} text="보내기" /> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
); | ||
} |