Skip to content

Commit

Permalink
fix : 북마크 상세보기 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
mmjjaa committed Jan 20, 2025
1 parent 5918b36 commit 78b6d81
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export const LetterDetailContainer = () => {
return <MapArchivedSentDetailLetter letterId={letterId} />;
}

if (letterId) {
return <MapBookmarkDetailLetter letterId={letterId} />;
}

if (replyLetterId) {
return (
<MapArchivedSentReplyDetailLetter
Expand Down Expand Up @@ -208,6 +212,38 @@ const MapDetailLetter = ({ letterId, lat, lot }: MapDetailLetterProps) => {
<LetterLayout.Title />
<LetterLayout.Content />
<LetterLayout.LetterHint />
<LetterLayout.MapBookmarkReplyButton />

Check failure on line 215 in src/components/LetterDetailPage/LetterDetailContainer/LetterDetailContainer.tsx

View workflow job for this annotation

GitHub Actions / Lighthouse CI

Property 'MapBookmarkReplyButton' does not exist on type '{ ({ letterData, children }: { letterData: LetterData; children: ReactNode; }): Element; Header: () => Element; Title: () => Element; Content: () => Element; Keyword: () => Element; ReplyButton: () => Element | null; LetterHint: () => Element; }'.
</LetterLayout>
</ThemeWrapper>
);
};

type MapBookmarkDetailLetterProps = {
letterId: string;
};
const MapBookmarkDetailLetter = ({
letterId
}: MapBookmarkDetailLetterProps) => {
const { data } = useGetArchivedLetter({
letterId: letterId
});

if (!data) {
return (
<ThemeWrapper themeId={1}>
<div>데이터가 존재하지 않습니다.</div>
</ThemeWrapper>
);
}

return (
<ThemeWrapper themeId={Number(data.paper)}>
<LetterLayout letterData={data}>
<LetterLayout.Header />
<LetterLayout.Title />
<LetterLayout.Content />
<LetterLayout.LetterHint />
<LetterLayout.MapBookmarkReplyButton />

Check failure on line 246 in src/components/LetterDetailPage/LetterDetailContainer/LetterDetailContainer.tsx

View workflow job for this annotation

GitHub Actions / Lighthouse CI

Property 'MapBookmarkReplyButton' does not exist on type '{ ({ letterData, children }: { letterData: LetterData; children: ReactNode; }): Element; Header: () => Element; Title: () => Element; Content: () => Element; Keyword: () => Element; ReplyButton: () => Element | null; LetterHint: () => Element; }'.
</LetterLayout>
</ThemeWrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/StoragePage/LetterListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const LetterListItem = ({
case 'map':
return `/letter/map/${filterType}/${letter.letterId}`;
case 'bookmark':
return `/letter/map/${filterType}/bookmark/${letter.letterId}`;
return `/letter/map/bookmark/${letter.letterId}`;
default:
throw new Error(
`Unsupported letter type: ${selectedLetterType}`
Expand Down

0 comments on commit 78b6d81

Please sign in to comment.