Skip to content

Commit

Permalink
chore : 메인페이지 추천/답장 편지 라우팅 경로 수정 (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangminguu authored Dec 9, 2024
1 parent 4ded7c0 commit e9aebe4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/components/HomePage/HomeBottleLetter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Label } from '../Common/BottleLetter/Label/Label';
import { useNavigate } from 'react-router-dom';

interface HomeBottleLetterProps {
letterType: 'keyword' | 'reply';
letterType: 'LETTER' | 'REPLY_LETTER';
labelUrl: string;
letterId: number;
}
Expand All @@ -18,9 +18,20 @@ export const HomeBottleLetter = ({
const navigate = useNavigate();

const handleClickBottle = () => {
navigate(`/letter/${letterType}/${letterId}`);
navigate(`letter/keyword/${letterType}/received/${letterId}`);
};

console.log('letterId - ', letterType);
console.log('letterId - ', letterId);

// 키워드 편지 경로
// /letter/keyword/LETTER/received/49

// + 답장의 경우 경로?
// + 아직 지도 편지 답장 경로는 설정하지 않았습니다.
// /letter/map/received/3
// /letter/keyword/REPLY_LETTER/received/5

return (
<div className="relative w-full h-full">
<div className="flex-center w-full h-full">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const LetterContainer = ({ letters }: LetterContainerProps) => {

// 추천편지의 경우 keyword, 답장편지의 경우 reply
const LetterType =
'labelUrl' in letter ? 'reply' : 'keyword';
'labelUrl' in letter ? 'REPLY_LETTER' : 'LETTER';

return (
<SwiperSlide key={i}>
Expand Down

0 comments on commit e9aebe4

Please sign in to comment.