diff --git a/src/components/Common/DayCounter/DayCounter.stories.tsx b/src/components/Common/DayCounter/DayCounter.stories.tsx index 0caa3b5c..a75cac53 100644 --- a/src/components/Common/DayCounter/DayCounter.stories.tsx +++ b/src/components/Common/DayCounter/DayCounter.stories.tsx @@ -13,5 +13,7 @@ export default meta; type Story = StoryObj; export const Default: Story = { - args: {} + args: { + daysLeft: 21 + } }; diff --git a/src/components/Common/DayCounter/DayCounter.tsx b/src/components/Common/DayCounter/DayCounter.tsx index acc91f39..1b88ff53 100644 --- a/src/components/Common/DayCounter/DayCounter.tsx +++ b/src/components/Common/DayCounter/DayCounter.tsx @@ -1,20 +1,22 @@ type DayCounterProps = { width?: string; height?: string; + daysLeft: number; }; export const DayCounter = ({ width = '66px', - height = '43px' + height = '30px', + daysLeft }: DayCounterProps) => { - const daysLeft = 21; - return (
- D-{daysLeft} + + D-{daysLeft} +
); }; diff --git a/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.stories.tsx b/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.stories.tsx index 2d980bae..5ccc8d19 100644 --- a/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.stories.tsx +++ b/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.stories.tsx @@ -14,11 +14,10 @@ type Story = StoryObj; export const Default: Story = { args: { + id: 123, title: '익명 편지', - keyword: '가을 바람', + distance: 400, date: '24.11.15', - clickEvent: () => { - alert('즐겁다'); - } + daysLeft: 21 } }; diff --git a/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.tsx b/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.tsx index 33222c8b..5b0a824e 100644 --- a/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.tsx +++ b/src/components/MapPage/LetterInfoContainer/LetterInfoContainer.tsx @@ -1,17 +1,21 @@ +import { DayCounter } from '@/components/Common/DayCounter/DayCounter'; import React from 'react'; +import { NavLink } from 'react-router-dom'; interface LetterInfoContainerProps { + id: number; title: string; - keyword: string; + distance: number; date: string; - clickEvent: () => void; + daysLeft: number; } export const LetterInfoContainer = ({ + id, title, - keyword, + distance, date, - clickEvent + daysLeft }: LetterInfoContainerProps) => { return (
@@ -19,19 +23,25 @@ export const LetterInfoContainer = ({
Bottle
-
+
+
+

작성일: {date}

+ +
+

{title}

-

키워드: {keyword}

-

작성일: {date}

+

+ 현재 위치에서 {distance}m +

- +
); }; diff --git a/src/components/MapPage/NavigateContainer/NavigateContainer.stories.tsx b/src/components/MapPage/NavigateContainer/NavigateContainer.stories.tsx index b66b4de3..af2690b3 100644 --- a/src/components/MapPage/NavigateContainer/NavigateContainer.stories.tsx +++ b/src/components/MapPage/NavigateContainer/NavigateContainer.stories.tsx @@ -14,11 +14,6 @@ type Story = StoryObj; export const Default: Story = { args: { - title: '가을 바람', - distance: '15km', - count: 4, - clickEvent: () => { - alert('헬로'); - } + count: 4 } }; diff --git a/src/components/MapPage/NavigateContainer/NavigateContainer.tsx b/src/components/MapPage/NavigateContainer/NavigateContainer.tsx index 15bd3579..2d5d8934 100644 --- a/src/components/MapPage/NavigateContainer/NavigateContainer.tsx +++ b/src/components/MapPage/NavigateContainer/NavigateContainer.tsx @@ -1,44 +1,17 @@ import React from 'react'; interface NavigateContainerProps { - title: string; - distance: string; count: number; - clickEvent: () => void; } export const NavigateContainer: React.FC = ({ - title, - distance, - count, - clickEvent + count }) => { return ( -
-
-
- {title} -
-

- 반경 {distance} 내 {count}개 -

- -
+
+

+ 반경 500m 내 {count}개 +

); };