Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

조회수 및 좋아요 수 기능 구현 #136

Merged
merged 11 commits into from
Jan 3, 2024
2 changes: 2 additions & 0 deletions client/src/components/board/PostDetail/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ display: none;
postTitle: 'Test Post',
postType: 'qna',
postUpdatedAt: '2023-06-01T02:25:31.176242',
likes: 0,
hits: 0,
};

const meta: Meta<typeof PostDetail> = {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/board/PostDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function PostDetail({ data, IS_AUTHOR }: PostDetail) {

<p className="text-gray-400">{parseDate(data?.postCreatedAt)}</p>
<hr />
<p className="text-sm text-gray-400">좋아요 0 | 조회 0</p>
<p className="text-sm text-gray-400">{`좋아요 ${data.likes} | 조회 ${data.hits}`}</p>
</article>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const mockPostInfoData: IPostInformation = {
postTitle: 'reDuck 입니다.',
postType: 'qna',
postUpdatedAt: '2023-06-01T02:25:31.176242',
likes: 0,
hits: 0,
};

const meta: Meta<typeof PostSummary> = {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/common/Post/PostSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function PostSummary({
/>
<div className="flex justify-between">
<div className="flex flex-col gap-1">
<p className="text-sm text-gray-400">좋아요 0 | 조회 0</p>
<p className="text-sm text-gray-400">{`좋아요 ${postInfoData.likes} | 조회 ${postInfoData.hits}`}</p>
<p className="text-gray-400">
{parseDate(postInfoData?.postCreatedAt)}
</p>
Expand Down
2 changes: 2 additions & 0 deletions client/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface IPostInformation {
postTitle: string;
postType: string;
postUpdatedAt: string;
hits: number;
likes: number;
}

export interface IBoardPostInformation
Expand Down
3 changes: 3 additions & 0 deletions client/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"installCommand": "yarn install"
}