Skip to content

Commit

Permalink
UI: #127 마크다운 컴포넌트 props 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Seok93 committed Sep 14, 2024
1 parent 6c00080 commit 52c634b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/common/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import CustomMarkdown from '@components/common/CustomMarkdown';
type MarkdownEditorProps = {
id: string;
label: string;
contentName: string;
contentFieldName: string;
};

export default function MarkdownEditor({ id, label, contentName }: MarkdownEditorProps) {
export default function MarkdownEditor({ id, label, contentFieldName }: MarkdownEditorProps) {
const [preview, setPreview] = useState(false);
const { watch, register } = useFormContext();

Expand All @@ -22,14 +22,14 @@ export default function MarkdownEditor({ id, label, contentName }: MarkdownEdito
<ToggleButton id="preview" checked={preview} onChange={handlePreviewToggle} />
</h3>
{preview ? (
<CustomMarkdown markdown={watch(contentName)} />
<CustomMarkdown markdown={watch(contentFieldName)} />
) : (
<textarea
id={id}
rows={10}
className="w-full border border-input p-10 placeholder:text-xs"
placeholder="마크다운 형식으로 입력해주세요."
{...register(contentName)}
{...register(contentFieldName)}
/>
)}
</label>
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/task/ModalTaskForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default function ModalTaskForm({ formId, project, taskId, onSubmit }: Mod
</section>
</div>

<MarkdownEditor id="content" label="내용" contentName="content" />
<MarkdownEditor id="content" label="내용" contentFieldName="content" />

<FileDropZone
id="files"
Expand Down

0 comments on commit 52c634b

Please sign in to comment.