-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: seriesDetailPage 리팩토링 및 관련 컴포넌트 추가, 댓글 컴포넌트 props 수정 #134
base: develop
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for monthsub ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for monthsub-dev ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
송님 고생많으셨습니다!!!
지금 comment부분 폴더 구조가 이렇게 폴더 안의 폴더 안의 파일로 되어있는데 폴더를 한겹 벗겨내도 좋을 것 같네요..ㅜㅜ
제 생각엔
comment
ㄴ index.jsx (기존의 CommentList/index.jsx)
ㄴ CommentForm.jsx
ㄴ CommentItem.jsx
로 구성하고
index.jsx안에서 CommentForm넣고 CommentItem은 그냥 map돌려도 좋을 것 같은데 어케 생각하시나요??
그리고 api는 페이지에서 import해서 props으로 내려주는게 베스트 같은데
대댓글 기능도 있어서 드릴링이 심해질 것 같긴하네요.. 이 부분은 저도 아직 코드가 잘 이해가 안돼서
게더나 디코로 한번 얘기해보면 좋을 것 같아요!!
...props | ||
}: ContentAddLinkProps): ReactElement => ( | ||
<StyledLink to={url} {...props}> | ||
<StyledLink to={`/series/${id}/article/write`} {...props}> |
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.
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.
앗 가 WriteListPage에도 쓰이는군요!! 사이드 이펙트를 고려하지 못했네요 ㅠㅠ 😂 이 부분은 원래대로 다시 수정해놓겠습니다!
comment 부분은 전체적으로 다시 구현 방법을 같이 논의해보면 좋을 것 같아요. 사실 api 분석도 안되었고 정책도 몰라서 수정이 어려울 듯 싶네요! 하루 날 잡고 같이 디코로 조인한번 하시죠!
@@ -86,112 +31,55 @@ const SeriesDetailPage = () => { | |||
}; | |||
|
|||
useEffect(() => { | |||
readSeriesDetail(); | |||
getInitialData(); |
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.
빈값 넣어주는 초기값 없애고 데이터 불리기 전엔 loading컴포넌트 나타나게 한거 맞죠??
loading컴포넌트랑 나타나고 없어지게 하는 로직을 provider로 만들어서 app에 적용해주고, 필요한 페이지에서 나타나고 없어지게 하는 함수만 실행해서 컨트롤하는 방법도 있더라고요!! 저희도 도입하면 깔끔해질 것 같아용 ㅎㅎ
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.
여기에 loading context 관련 내용을 남겨주셨군용! 😎
우선, 위 함수는 그저 일관성을 위해 네이밍만 바꾼거예요ㅋㅋㅋ
📝 Tasks
📝 Results
📝 논의점
seriesDetailPage 리팩토링
if (loading) return <Loading />;
이 코드로 대체함으로써 가독성 개선 (다른 페이지도 바꿀 예정)댓글 컴포넌트 props 수정
앞으로 해야할일! (송이)