-
Notifications
You must be signed in to change notification settings - Fork 0
포스트 조회수 기능 구현 #1
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
base: temp
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Case B]
}, | ||
}); | ||
|
||
const filledStats = useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[p3] 해당 로직을 별도의 helper 함수로 추출하여 descriptive한 이름을 부여하면 가독성이 좋을 것 같습니다.
@@ -212,6 +212,10 @@ const PostViewer: React.FC<PostViewerProps> = ({ | |||
history.push(`/write?id=${post.id}`); | |||
}; | |||
|
|||
const onOpenStats = () => { | |||
history.push(`/post-stats/${post.id}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React router에서 제공하는 hook을 다시 래핑해서 useRouter 훅을 만든 예시도 있어서 신기해서 가져와보았습니다.
countMap.set(format(new Date(item.day), 'yyyy-MM-dd'), item.count); | ||
}); | ||
|
||
const lastDate = new Date(items[0].day); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[p5] 일관성 있는 naming rule이 필요할거 같습니다.
lastDate
currentDate
@@ -35,14 +35,16 @@ declare module '*.png' { | |||
} | |||
|
|||
declare module '*.webp' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare 잘 모릅니다. 설명 가능하신 분 계실까요?
https://velog.io/@velog/post-stats-update
원래 PR