diff --git a/src/components/Common/NotificationBadge/NotificationBadge.stories.tsx b/src/components/Common/NotificationBadge/NotificationBadge.stories.tsx deleted file mode 100644 index 18397485..00000000 --- a/src/components/Common/NotificationBadge/NotificationBadge.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { NotificationBadge } from './NotificationBadge'; - -const meta: Meta = { - component: NotificationBadge, - title: 'atoms/NotificationBadge', - tags: ['autodocs'], - argTypes: {} -}; -export default meta; - -type Story = StoryObj; - -export const notificationMin: Story = { - args: { badgeType: 'basic', count: 1 } -}; - -export const notificationMax: Story = { - args: { badgeType: 'basic', count: 100 } -}; - -export const dday: Story = { - args: { badgeType: 'dday', count: 5 } -}; diff --git a/src/components/LetterDetailPage/Delete/DeleteModal.tsx b/src/components/LetterDetailPage/Delete/DeleteModal.tsx index f7aee84f..f0a2973b 100644 --- a/src/components/LetterDetailPage/Delete/DeleteModal.tsx +++ b/src/components/LetterDetailPage/Delete/DeleteModal.tsx @@ -15,28 +15,29 @@ export const DeleteModal = ({ closeModal }: DeleteModalProps) => { const navigate = useNavigate(); const { pathname } = useLocation(); const letterType = pathname.split('/')[2]; - const { dataType, letterId } = useParams<{ + const { dataType, letterId, replyLetterId } = useParams<{ dataType: string; letterId: string; + replyLetterId: string; }>(); const transformedLetterType = dataType === 'sent' ? 'SEND' : 'RECEIVE'; const keywordMutation = useDeleteKeywordLetter({ - letterId: Number(letterId), + letterId: Number(letterId) || Number(replyLetterId), boxType: transformedLetterType }); const mapMutation = useDeleteMapSentLetter({ - letterIds: [Number(letterId)] + letterIds: [Number(letterId) || Number(replyLetterId)] }); const keywordReplyMutation = useDeleteKeywordReplyLetter({ - letterId: Number(letterId), + letterId: Number(letterId) || Number(replyLetterId), boxType: transformedLetterType }); const mapReceivedMutation = useDeleteMapReceivedLetter({ - letterIds: [Number(letterId)] + letterIds: [Number(letterId) || Number(replyLetterId)] }); const mutation = diff --git a/src/components/LetterDetailPage/LetterDatail/KeywordLetterDetail/KeywordLetterDetail.tsx b/src/components/LetterDetailPage/LetterDatail/KeywordLetterDetail/KeywordLetterDetail.tsx index 249b8f87..9c35605f 100644 --- a/src/components/LetterDetailPage/LetterDatail/KeywordLetterDetail/KeywordLetterDetail.tsx +++ b/src/components/LetterDetailPage/LetterDatail/KeywordLetterDetail/KeywordLetterDetail.tsx @@ -4,8 +4,8 @@ import { Margin } from '@/components/Common/Margin/Margin'; import { KeywordList } from '../../Keyword/KeywordList'; import { DeleteButton } from '../../Delete/DeleteButton'; import clsx from 'clsx'; -import { useGetKeywordReplyList } from '@/hooks/useGetKeywordReplyList'; -import { ReplyList } from '../../ReplyList/ReplyList'; +// import { useGetKeywordReplyList } from '@/hooks/useGetKeywordReplyList'; +// import { ReplyList } from '../../ReplyList/ReplyList'; import { ReportButton } from '../../Report/ReportButton'; import { useParams, useNavigate } from 'react-router-dom'; import { Label } from '@/components/Common/BottleLetter/Label/Label'; @@ -19,6 +19,7 @@ type KeywordLetterDetailProps = { createdAt: string; font: string; label: string; + isReplied?: boolean; }; }; @@ -30,28 +31,35 @@ export const KeywordLetterDetail = ({ letterType: string; }>(); const navigate = useNavigate(); - const { letterId, title, content, keywords, createdAt, font, label } = - letterData; - const { - data: keywordReplyListData, - isLoading: isKeywordReplyListDataLoading, - error: keywordReplyListDataError - } = useGetKeywordReplyList({ - letterId: Number(letterId) || 0, - page: 1, - size: 1, - sort: 'createdAt' - }); + letterId, + title, + content, + keywords, + createdAt, + font, + label, + isReplied + } = letterData; + + // const { + // data: keywordReplyListData, + // isLoading: isKeywordReplyListDataLoading, + // error: keywordReplyListDataError + // } = useGetKeywordReplyList({ + // letterId: Number(letterId) || 0, + // page: 1, + // size: 1, + // sort: 'createdAt' + // }); - if (isKeywordReplyListDataLoading) { - return
로딩 중...
; - } + // if (isKeywordReplyListDataLoading) { + // return
로딩 중...
; + // } - if (keywordReplyListDataError instanceof Error) { - return
오류...: {keywordReplyListDataError.message}
; - } - console.log(keywordReplyListData); + // if (keywordReplyListDataError instanceof Error) { + // return
오류...: {keywordReplyListDataError.message}
; + // } return (
@@ -63,7 +71,7 @@ export const KeywordLetterDetail = ({
- {dataType === 'received' && } + {letterType === 'REPLY_LETTER' && }

{title}

@@ -74,90 +82,34 @@ export const KeywordLetterDetail = ({
-

편지의 키워드

+ {keywords &&

편지의 키워드

}

{formatDate(createdAt)}

{keywords && } - {dataType === 'sent' && keywordReplyListData?.content ? ( + {/* {dataType === 'sent' && keywordReplyListData?.content ? (
- ) : null} + ) : null} */} - {dataType === 'received' && letterType === 'LETTER' && ( - - )} + {dataType === 'received' && + letterType === 'LETTER' && + !isReplied && ( + + )} ); }; - -/* -
- {letterId && ( -
- - {!data?.isOwner && } -
- )} -
- {labelItem.name} - {type === 'map' ? ( - - ) : ( - data && - )} -
-
- - {data?.isOwner ? ( - hasReplies ? ( -
- -
- ) : null - ) : type === 'map' ? ( -
- {!data?.isOwner && ( - <> - - - - )} -
- ) : ( -
- {!data?.isOwner && ( - - )} -
- )} -*/ diff --git a/src/components/LetterDetailPage/LetterDatail/MapLetterArchieveDetail/MapLetterArchieveDetail.tsx b/src/components/LetterDetailPage/LetterDatail/MapLetterArchieveDetail/MapLetterArchieveDetail.tsx index e3005742..ea574faf 100644 --- a/src/components/LetterDetailPage/LetterDatail/MapLetterArchieveDetail/MapLetterArchieveDetail.tsx +++ b/src/components/LetterDetailPage/LetterDatail/MapLetterArchieveDetail/MapLetterArchieveDetail.tsx @@ -5,18 +5,18 @@ import clsx from 'clsx'; import { DeleteButton } from '../../Delete/DeleteButton'; import { TextArea } from '@/components/Common/TextArea/TextArea'; import { useGetMapReplyList } from '@/hooks/useGetMapReplyList'; -import { ReplyList } from '../../ReplyList/ReplyList'; +// import { ReplyList } from '../../ReplyList/ReplyList'; import { ReportButton } from '../../Report/ReportButton'; import { useLocation } from 'react-router-dom'; import { Label } from '@/components/Common/BottleLetter/Label/Label'; type MapLetterDetailProps = { letterData: { - title: string; + title?: string; content: string; - description: string; + description?: string; createdAt: string; - profileImg: string; + profileImg?: string; font: string; paper: string; label: string; @@ -90,14 +90,14 @@ export const MapLetterArchieveDetail = ({ {DayCounter({ createdAt })} - {mapReplyListData?.content ? ( + {/* {mapReplyListData?.content ? (
- ) : null} + ) : null} */} ); diff --git a/src/components/LetterDetailPage/LetterDatail/MapLetterDetail/MapLetterDetail.tsx b/src/components/LetterDetailPage/LetterDatail/MapLetterDetail/MapLetterDetail.tsx index 54653a04..21c65c08 100644 --- a/src/components/LetterDetailPage/LetterDatail/MapLetterDetail/MapLetterDetail.tsx +++ b/src/components/LetterDetailPage/LetterDatail/MapLetterDetail/MapLetterDetail.tsx @@ -146,13 +146,15 @@ export const MapLetterDetail = ({ letterData }: MapLetterDetailProps) => { {!isOwner && ( <>
- - {!isReplied && ( + {!isStored && ( + + )} + {isReplied !== undefined && !isReplied && (