diff --git a/src/components/OthersDayBook.tsx b/src/components/OthersDayBook.tsx index 12167bc..e208584 100644 --- a/src/components/OthersDayBook.tsx +++ b/src/components/OthersDayBook.tsx @@ -47,7 +47,7 @@ const OthersWriting = () => { {daybookData && } - + ); }; diff --git a/src/components/OthersDayBookFooter.tsx b/src/components/OthersDayBookFooter.tsx index fb5cf04..35b584a 100644 --- a/src/components/OthersDayBookFooter.tsx +++ b/src/components/OthersDayBookFooter.tsx @@ -2,11 +2,15 @@ import styled from "@emotion/styled"; import { colors } from "@theme"; import { Link } from "react-router-dom"; -const OthersWritingFooter = () => { +interface OthersWritingFooterProps { + id: number; +} + +const OthersWritingFooter = ({ id }: OthersWritingFooterProps) => { return (
- 나도 일지 작성하기 + 나도 일지 작성하기
); diff --git a/src/pages/write/index.tsx b/src/pages/write/index.tsx index 0efbe5d..c2fa926 100644 --- a/src/pages/write/index.tsx +++ b/src/pages/write/index.tsx @@ -30,6 +30,7 @@ function Write() { const { isLoading, step, nextStep, previousStep } = useStep(); const [searchParams] = useSearchParams(); const query = searchParams.get("from"); + const id = searchParams.get("id"); const StepComponent = STEP_COMPONENTS[step]; const { title, description, buttonText } = StepContentMap.get( @@ -49,8 +50,17 @@ function Write() { }; useEffect(() => { - setDaybook(RESET); - }, [setDaybook]); + if (!id) { + setDaybook(RESET); + } else { + setDaybook({ + respectBoardId: Number(id), + content: '', + category: '', + hashtags: [], + }) + } + }, [setDaybook, id]); if (isLoading) return ;