diff --git a/src/components/common/CustomMarkdown.tsx b/src/components/common/CustomMarkdown.tsx index f9373f22..2bee201e 100644 --- a/src/components/common/CustomMarkdown.tsx +++ b/src/components/common/CustomMarkdown.tsx @@ -137,10 +137,25 @@ const component: Partial = { }; function getChangedMarkdownForLineBreak(markdown: string) { - return markdown - .split('\n') - .map((sentence) => (sentence === '' ? '\n
\n' : sentence)) - .join('\n'); + const lines = markdown.split('\n'); + + let inCodeBlock = false; + const resultLines: string[] = []; + lines.forEach((line) => { + if (line.trim().startsWith('```')) { + inCodeBlock = !inCodeBlock; + resultLines.push(line); + return; + } + + if (!inCodeBlock && line.trim() === '') { + resultLines.push('\n
\n'); + } else { + resultLines.push(line); + } + }); + + return resultLines.join('\n'); } export default function CustomMarkdown({ markdown }: CustomMarkdownProps) { diff --git a/src/components/modal/project-status/ModalProjectStatusForm.tsx b/src/components/modal/project-status/ModalProjectStatusForm.tsx index 2e1afed8..5aa29e0f 100644 --- a/src/components/modal/project-status/ModalProjectStatusForm.tsx +++ b/src/components/modal/project-status/ModalProjectStatusForm.tsx @@ -39,27 +39,27 @@ export default function ModalProjectStatusForm({ formId, project, statusId, onSu />

색상

- {usableColorList.map(({ color, isUsable }, index) => ( + {usableColorList.map(({ colorCode, isUsable }, index) => (
))}
- {errors.color &&
{errors.color.message}
} + {errors.colorCode &&
{errors.colorCode.message}
} ); } diff --git a/src/components/modal/project/ModalProjectForm.tsx b/src/components/modal/project/ModalProjectForm.tsx index 8b47a655..aba2c8ca 100644 --- a/src/components/modal/project/ModalProjectForm.tsx +++ b/src/components/modal/project/ModalProjectForm.tsx @@ -5,10 +5,11 @@ import type { Project } from '@/types/ProjectType'; type ModalProjectFormProps = { formId: string; + projectId?: Project['projectId']; onSubmit: SubmitHandler; }; -export default function ModalProjectForm({ formId, onSubmit }: ModalProjectFormProps) { +export default function ModalProjectForm({ formId, projectId, onSubmit }: ModalProjectFormProps) { const { handleSubmit } = useForm(); return (
diff --git a/src/components/modal/task/ModalTaskForm.tsx b/src/components/modal/task/ModalTaskForm.tsx index 214a5a73..2e0b5b6c 100644 --- a/src/components/modal/task/ModalTaskForm.tsx +++ b/src/components/modal/task/ModalTaskForm.tsx @@ -167,7 +167,7 @@ export default function ModalTaskForm({ formId, project, taskId, onSubmit }: Mod {/* ToDo: 상태 선택 리팩토링 할 것 */}
{statusList.map((status) => { - const { statusId, name, color } = status; + const { statusId, name, colorCode } = status; const isChecked = +watch('statusId') === statusId; return (