-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
160 feat 답장 편지 상세보기 페이지 레이아웃 개발 완료 (#163)
* feat : 답장 편지 상세보기 페이지 레이아웃 개발 완료 * feat : 답장 상세보기 페이지 라우팅 * chore : ReplyList.stories 수정 * chore : HomePage.stories 수정
- Loading branch information
Showing
8 changed files
with
126 additions
and
6 deletions.
There are no files selected for viewing
10 changes: 9 additions & 1 deletion
10
src/components/LetterDetailPage/ReplyList/ReplyList.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { ReplyLetterDetailPage } from './ReplyLetterDetailPage'; | ||
import { Route, Routes, MemoryRouter } from 'react-router-dom'; | ||
|
||
const meta: Meta<typeof ReplyLetterDetailPage> = { | ||
component: ReplyLetterDetailPage, | ||
title: 'Pages/ReplyLetterDetailPage', | ||
tags: ['autodocs'] | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ReplyLetterDetailPage>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
decorators: [ | ||
(Story) => { | ||
return ( | ||
<MemoryRouter initialEntries={['/letter/reply/123']}> | ||
<Routes> | ||
<Route path="/letter/reply/:id" element={<Story />} /> | ||
</Routes> | ||
</MemoryRouter> | ||
); | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { BackButton } from '@/components/Common/BackButton/BackButton'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { useParams } from 'react-router-dom'; | ||
import { DeleteButton } from '@/components/LetterDetailPage/DeleteButton/DeleteButton'; | ||
import { ReplyLetterDetail } from '@/components/LetterDetailPage/ReplyLetterDetail'; | ||
|
||
export const ReplyLetterDetailPage = () => { | ||
const { id } = useParams<{ id: string }>(); | ||
|
||
const imageItem = { | ||
id: '편지지_샘플_1', | ||
name: '이미지', | ||
src: '/편지지_샘플_1.png' | ||
}; | ||
const labelItem = { | ||
id: '라벨_샘플', | ||
name: '이미지', | ||
src: '/라벨_샘플.png' | ||
}; | ||
|
||
const navigate = useNavigate(); | ||
|
||
const onDeleteClick = (letterId: string) => { | ||
console.log(`편지 ID ${letterId} 삭제`); | ||
alert('편지를 삭제하시겠습니까?'); | ||
navigate(-1); | ||
}; | ||
const onBackClick = () => { | ||
navigate(-1); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className="mt-4 mx-auto max-w relative"> | ||
<div className="mx-auto w-[710px]"> | ||
<BackButton onClick={onBackClick} /> | ||
</div> | ||
{id && ( | ||
<div className="mt-10 absolute top-0 right-8"> | ||
<DeleteButton id={id} onClick={onDeleteClick} /> | ||
</div> | ||
)} | ||
<div className="mt-16 flex-center relative"> | ||
<img | ||
src={imageItem.src} | ||
alt={imageItem.name} | ||
className="w-[710px] h-[900px] relative" | ||
/> | ||
<img | ||
src={labelItem.src} | ||
alt={labelItem.name} | ||
className="absolute top-4 translate-x-40 w-[125.32px] h-[201.1px]" | ||
/> | ||
|
||
<ReplyLetterDetail | ||
title="편지제목" | ||
content="편지내용" | ||
date="24.11.18" | ||
/> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters