-
-
-
-
-
-
-
{likeCount}
+ {isShareLetterPreview ? (
+
+ ) : (
+
+
+
+ )}
+
+ {!isShareLetterPreview && (
+
+
+
+
{likeCount}
+
+ {isWriter ? (
+
+ ) : (
+
+ )}
- {isWriter ? (
-
- ) : (
-
- )}
-
+ )}
diff --git a/src/pages/LetterBoardDetail/index.tsx b/src/pages/LetterBoardDetail/index.tsx
index 2292ff9..35abe1c 100644
--- a/src/pages/LetterBoardDetail/index.tsx
+++ b/src/pages/LetterBoardDetail/index.tsx
@@ -1,4 +1,6 @@
import { useState } from 'react';
+import { useLocation } from 'react-router';
+
import { twMerge } from 'tailwind-merge';
import ReportModal from '@/components/ReportModal';
@@ -6,6 +8,7 @@ import ReportModal from '@/components/ReportModal';
import Header from './components/Header';
import Letter from './components/Letter';
+import BlurImg from '@/assets/images/landing-blur.png';
const DUMMY_LETTER = {
receiver: '12E21',
content:
@@ -13,7 +16,18 @@ const DUMMY_LETTER = {
sender: '12345',
};
-const LetterBoardDetailPage = () => {
+interface ShareLetterPreviewProps {
+ confirmDisabled?: boolean;
+ children?: React.ReactNode;
+ onCancel?: () => void;
+ onConfirm?: () => void;
+}
+
+const LetterBoardDetailPage = ({
+ confirmDisabled,
+ onCancel,
+ onConfirm,
+}: ShareLetterPreviewProps) => {
const [likeCount, setLikeCount] = useState(122);
const [isLike, setIsLike] = useState(false);
const isWriter = false;
@@ -24,6 +38,11 @@ const LetterBoardDetailPage = () => {
setIsLike((prev) => !prev);
};
+ const location = useLocation();
+
+ const isShareLetterPreview = location.state?.isShareLetterPreview || false; // state가 없다면 false로 기본값 설정
+ console.log(location);
+
return (
<>
{activeReportModal &&
setActiveReportModal(false)} />}
@@ -34,6 +53,7 @@ const LetterBoardDetailPage = () => {
isWriter={isWriter}
onToggleLike={handleToggleLike}
onOpenReportModal={() => setActiveReportModal(true)}
+ isShareLetterPreview={isShareLetterPreview}
/>
FROM. 12E31
@@ -56,6 +76,29 @@ const LetterBoardDetailPage = () => {
+
+ {isShareLetterPreview && (
+ <>
+
+
+ >
+ )}
>