-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feat/#300 best piickle #301
Conversation
우와아아앙😆 개발 부분 공유를 엄청 자세히 해주셨네요!! 짱짱✨✨ (+) 질문할 부분 1번 저도 같은 오류가 발생해서, |
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.
은형이 평일에 일정 많은데!!!! 열심히 하고 있구나 믓찌다 증말 ♡〜٩( ˃́▿˂̀ )۶〜♡
api 연결두 파이티이이이이잉~!~!!!!
color: ${({ theme }) => theme.colors.white}; | ||
background-color: ${({ theme }) => theme.newColors.gray900}; | ||
backdrop-filter: blur(0.6rem); | ||
color: ${({ theme }) => theme.colors.gray700}; |
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.
theme.newColors
로 쓰면 좋을 것 같아요!
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.
수정했습니다 감사합니다!
src/util/best/bestPiickleTitles.ts
Outdated
export const rankTitles: HeadingTitle = { | ||
title: "베스트 피클 랭킹", | ||
content: "가장 많이 북마크한 대화주제를 확인해보세요", | ||
isMoreBtn: false, | ||
}; | ||
|
||
export const recommendTitles: HeadingTitle = { | ||
title: "이런 베스트 피클은 어때요?", | ||
content: "", | ||
isMoreBtn: false, | ||
}; |
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.
분리 아주 좋아요~:D
베스트피클 페이지는 더보기 버튼이 없어서, isMoreBtn
은 삭제해도 좋을 것 같네요!
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.
이거 따로 빼낸 이유가 뭘까요??
상수 선언이 해당하는 컴포넌트에서만 사용되는데, 그 곳에서 사용하는 게 읽기 편하지 않을까요??/
저도 이전에 "정리"를 위한 상수 분리를 많이 했었는데,
그렇게 되면 문제가 해당 파일에서 확인하면 되는 것을 한 번 뎁스를 가지고 타고 와야 한다는 것이 시간적으로 문제가 된다는 것이에요
다시 말해서, (지금은 단순 const 객체이지만, 이후 분리, 모듈화를 진행할 때)
재사용, next engineer를 위한 모듈화가 되어야지, 단순 정리를 위한 서랍장을 만드는 것은, 그 컨텍스트를 이해하기 위해 서랍장을 만드는 사람의 의도를 파악까지 해야하는 문제가 생겨요
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.
MainPage
만 참고하고 headingTitles
상수를 따로 선언했는데, 지금 다른 컴포넌트들을 보니 그냥 상단에서 선언했네요!
정리를 위한 상수 분리는 확실히 피로도만 올리는 작업이겠네요. 앞으로 유념해야겠습니다 !
나연님이 말씀하신대로 isMoreBtn
은 불필요하긴 한데, 없으면 타입 에러가 나더라고요. 그래서 type에서 isMoreBtn
만 옵셔널 프로퍼티로 바꾸고, 아래에서 주함님이 말씀하신대로 routePath
여부에 따라 undefined 검사를 하도록 하겠습니다.
의견 감사해요!
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.
코드와 타협하는 방향은 좋지 않다고 생각돼요
그 isMoreBtn 타입이 있았던 이유가 라우트 패쓰 옵션이 없었기 때문에 더보기가 있나없나를 판별하기 위해 있던 인터페이스였고,
라우트 패쓰가 있다 = 더보기 버튼이 있다 라는 도메인이 성립이 된다면, (저는 된다 생각돼요)
isMoreBtn 인터페이스 자체를 없애주는 방향으로 가는게 맞지 않나 싶어요??
<SuspenseBoundary> | ||
<BestPiickleRank /> | ||
<BestPiickleRecommend /> | ||
</SuspenseBoundary> |
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.
얼.. SuspenseBoundary
바로 적용해서 쓰네! 멋있다은형이!!!!!
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.
다른 페이지들에서 잘 적용되어있어서 많이 참고했어! ㅎㅎㅎ
${({ theme }) => theme.newFonts.body4}; | ||
color: white; | ||
text-align: center; | ||
letter-spacing: -0.056rem; /* todo: 흠.. 폰트왜 다르지 */ |
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.
ㅎㅎ.. 채민이한테 이야기 해야긋다! body4랑 letter-spacing
만 다른 건가요?-?
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.
전체적으로 letter-spacing
이 다른 것 같아요!
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 2.8rem; | ||
height: 2.8rem; | ||
cursor: pointer; |
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.
굿굿~! style 코드짤 때, 관련된 것끼리 띄어쓰기 해주면 좋을 것 같아요!
export const BookmarkWrapper = styled.div`
width: 2.8rem;
height: 2.8rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
`;
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.
넵! 감사합니다😄
${({ theme }) => theme.newFonts.body4}; | ||
color: ${({ theme }) => theme.newColors.gray900}; | ||
|
||
// 말줄임표설정 |
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.
넵 수정했습니다!
@@ -17,4 +18,4 @@ export const routePaths = { | |||
Join_UserInfo: "user-info", | |||
}; | |||
|
|||
export type RoutePaths = typeof routePaths[keyof typeof routePaths]; | |||
export type RoutePaths = (typeof routePaths)[keyof typeof routePaths]; |
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.
Prettier 자동완성이라 없으면 오류가 나는데, 저만 그런걸까요?!
@@ -26,7 +34,7 @@ export default function RankItem(props: RankItemProps) { | |||
<St.BookmarkWrapper onClick={toggleBookmark}> | |||
<IcBookmarkCheck_16_20 isChecked={isBookmarked} /> | |||
</St.BookmarkWrapper> | |||
<St.RankItemLink type="button" /> | |||
<St.RankItemLink type="button" onClick={() => navigateCardCollection(idx)} /> |
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.
이 부분이 이어서 베스트 피클 카도 보기
버튼이죠? navigateCardCollection
대신 다른 함수명은 어떨까요?-?
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.
navigateRankCollection
으로 변경하겠습니다! 좋은 의견이에요:)
|
||
return ( | ||
<St.Container> | ||
<St.Container paddingVerticalValue={paddingVerticalValue ?? 2.4}> |
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.
세심한 사람..‧⁺( ᵒ̴̶̷̥́ ◡ ᵒ̴̶̷̣̥̀ )⁺‧
|
||
export default function BestPiickleRecommend() { | ||
const { bestPiickle } = useBestPiickle(); | ||
const { scrollableContainerProps, isDragging } = useScrollableContainer(); // 요거 먼가요?? |
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.
베스트피클을 보면 좌우 슬라이드가 가능한데요! 그 부분을 라이브러리 쓰지 않고 overflow-x: scroll;
로 만들었어요! 그래서 데스크탑에서도 드래그 가능하게끔 구현한 hook입네다!
다시 한 번 주함오빠 최고 ( ゚ヮ゚)/ ( ゚ヮ゚)/
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.
맞습니다! 정확히는 마우스 끌기로 스와이핑하기 위한 이벤트 핸들러를 정의해주는 훅이에요
이제 보니 useDraggingContainer
? 처럼 이름이 바뀌면 좋을 것 같네요!
바꿔주셔도 좋습니다
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.
역시 이주함,,, useDraggingContainer
로 변경하겠습니다!
이건 개인적인 의견인데, 이런 라이브러리 대체용? 훅들은 따로 lib
폴더에서 따로 관리하는 경우도 있더라구요.
그리고 거기에 있는 기능들은 실제 라이브러리를 구현할 때처럼 개발해, 경험삼아 연습하기에도 좋다고 합니다!
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.
역시역시👍🏼👍🏼👍🏼👍🏼 고생 많았어요
혹시 PR 문서를 쓰는 데에 시간이 많이 걸리지는 않나요??
상세히 설명해주는 것은 좋지만, 정말 알아야 할 부분들만 컴팩트하게 적어야 쓰는 사람도 읽는 사람도 효율적으로 공유할 수 있지 않을까 싶어요! (부담없이 써도 된다는 이야기)
/best 페이지에서 헤더부분의 메뉴를 누르면 에러가 나는 경우가 있었습니다. (지금은 또 잘 되네요..😅) 제가 라우팅에서 뭔가
말이 끊긴듯한..🔉🔉
이건 중요한 질문인데, 개발하면서 다른 부분 참고하면서 간혹 가다가 position: fixed ...로 클릭부분을 지정해놓은 부분을 발견했어요. QA 과정에서 클릭범위를 지정하기 위해 일부러 그렇게 하신 것인지 궁금합니다!
이게 어느 부분이죠??!
src/util/best/bestPiickleTitles.ts
Outdated
export const rankTitles: HeadingTitle = { | ||
title: "베스트 피클 랭킹", | ||
content: "가장 많이 북마크한 대화주제를 확인해보세요", | ||
isMoreBtn: false, | ||
}; | ||
|
||
export const recommendTitles: HeadingTitle = { | ||
title: "이런 베스트 피클은 어때요?", | ||
content: "", | ||
isMoreBtn: false, | ||
}; |
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.
이거 따로 빼낸 이유가 뭘까요??
상수 선언이 해당하는 컴포넌트에서만 사용되는데, 그 곳에서 사용하는 게 읽기 편하지 않을까요??/
저도 이전에 "정리"를 위한 상수 분리를 많이 했었는데,
그렇게 되면 문제가 해당 파일에서 확인하면 되는 것을 한 번 뎁스를 가지고 타고 와야 한다는 것이 시간적으로 문제가 된다는 것이에요
다시 말해서, (지금은 단순 const 객체이지만, 이후 분리, 모듈화를 진행할 때)
재사용, next engineer를 위한 모듈화가 되어야지, 단순 정리를 위한 서랍장을 만드는 것은, 그 컨텍스트를 이해하기 위해 서랍장을 만드는 사람의 의도를 파악까지 해야하는 문제가 생겨요
@@ -0,0 +1,40 @@ | |||
import React, { useState } from "react"; |
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.
import React
자동완성 때문인지 선언이 좀 있네요! 없어도 될 것 같아요
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.
확인했습니다 감사합니다!
interface RankItemProps { | ||
cardId: string; | ||
content: string; | ||
idx: number; | ||
} |
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.
idx
가 아니라 rank
가 되어야 RankItem에 맞는 인터페이스일 것 같아요
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.
좋은 의견이에요! 감사합니다:)
|
||
export default function BestPiickleRecommend() { | ||
const { bestPiickle } = useBestPiickle(); | ||
const { scrollableContainerProps, isDragging } = useScrollableContainer(); // 요거 먼가요?? |
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.
맞습니다! 정확히는 마우스 끌기로 스와이핑하기 위한 이벤트 핸들러를 정의해주는 훅이에요
이제 보니 useDraggingContainer
? 처럼 이름이 바뀌면 좋을 것 같네요!
바꿔주셔도 좋습니다
<St.Wrapper ismore={headingTitles.isMoreBtn}> | ||
<St.Title>{headingTitles.title}</St.Title> | ||
<St.Content>{headingTitles.content}</St.Content> | ||
</St.Wrapper> | ||
{headingTitles && headingTitles.isMoreBtn && ( | ||
<St.Link to={routePaths.Category} className={GTM_CLASS_NAME.mainMoodPiickleMore}> | ||
{headingTitles && headingTitles.isMoreBtn && routePath && ( |
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.
routePath 인터페이스를 뚫어서 유연하게 사용이 가능해졌ㅆ네!!!!
그러면- isMoreBtn 타입을 아예 없어도 될 것 같아요. routePath의 유무로 moreBtn이 있는지 확인하면 어떨까 합니다.
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에서 마지막 질문은 나연언니가 갠톡해줘서, 디자인팀과 논의 후 다시 결정하기로 했어요!
PR 문서는 .. 첫 PR이라서 정성스럽게 써봤어요 🤭ㅋㅋㅋㅋㅋ
FYI) |
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.
(말 많아서 죄송합니다) 그~~ 새 작업을 하고, 새 리뷰를 요청하실 때는 다시 review request를 걸어주세요!
리뷰를 원하는지 아닌지 파악할 수 있게!!
const onClickCard = () => { | ||
if (!canNavigate) return; | ||
navigateCardCollection(idx); | ||
}; |
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.
(생각해보면 좋을 것 같아요)
- 따로 빼준 이유가 있나요??
handle~
이 아니라,on~
인 이유가 있나요??
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.
- 두줄 이상이라면 따로 빼는게 가독성이 좋을 거라고 생각했습니다!
- 앗 습관상 on으로 적어버렸네요 ! 다른 핸들러들은 handle인것 확인했습니다. 바꿀게요!
isLast?: boolean; | ||
} | ||
|
||
export default function BestPiickleCard(props: BestPiickleCardProps) { |
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.
생각없이 해버렸네요 🥲 주의하겠습니다
}; | ||
idx: number; | ||
canNavigate: boolean; | ||
isLast?: boolean; |
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.
(생각해보면 좋을 것 같아요)
last card에 대한 내용을 컴포넌트로 분리해서 LastBestPiickleCard
로 하지 않고,
컴포넌트 내에서 last card에 대한 내용을 하는 것이 옳은 인터페이스일까요?
장단점이 뭘까요???
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.
해놓고 리팩토링한다는 걸 깜빡했네요😅
단점은 아무래도 파일이 많아지면서 번들 크기가 증가한다는 것일거고, 경우에 따라 props drilling문제도 생길 것 같아요!
그런데 지금 LastCard는 필요로하는 props가 없으니까 말씀하신대로 컴포넌트를 분리하는 게 좋을 것 같아요:)
|
||
return ( | ||
<St.Container type="button" className={GTM_CLASS_NAME[GTM_IDX_KEY]} onClick={onClickCard}> | ||
{isLast ? ( |
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.
isLast
말씀하시는거 맞나요? 바뀌었다는게 무슨 말이죠?!
bestPiickle={bestPiickle} | ||
idx={idx} | ||
canNavigate={!isDragging} | ||
isLast={idx !== 5} |
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.
slice(0, 5) 면 idx가 0
-4
아닌가요.>~!?
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.
로직을 잘못 생각했었어요! isLast
이면 기본카드가 나오게 해놨었네요 !isLast
로 고쳤어요
알주셔서 감삼다 (_ _)
📌 내용
'베스트피클더보기 페이지' 뷰를 완성합니다
BestPiickleRank
와BestPiickleRecommend
로 명명하였습니다RankItem
컴포넌트로 세분화했어요 (RecommendItem도 리팩토링 예정)공통컴포넌트 일부를 수정합니다
HeadingTitleContainer
수정:paddingVerticalValue
와routePath
를 옵셔널 프로퍼티로 추가합니다.2.4rem
이고, 이와 다를 경우에는 paddingVerticalValue를 rem 값 기준으로 전달해주시면 됩니다.to={routePaths.Cateogry}
로 하드코딩 되어있던 부분을routePath
로 수정했어요.BestPiickleCard
수정: new디자인을 반영했어요.기타
📌 내가 알게 된 부분
[ design ]
으로 명시해야하는데[ fix ]
로 적어버렸네요🥹 다음번부터는 꼭 지키겠습니다 !BestPiicklePage
라고 명시했지만, 기획상 정확한 명칭은 '베스트피클더보기 페이지' 였네요.📌 질문할 부분
/best
페이지에서 헤더부분의 메뉴를 누르면 에러가 나는 경우가 있었습니다. (지금은 또 잘 되네요..😅)./style
import 방식이 달라 고민하다가 일단import * as St from './style'
로 개발하였습니다. 해당 방식과 `import St from './style' (./style 파일에서 St객체를 export 하는 방식)중 어떤 방식으로 할지 정하면 제가 통일해놓을게요position: fixed ...
로 클릭부분을 지정해놓은 부분을 발견했어요. QA 과정에서 클릭범위를 지정하기 위해 일부러 그렇게 하신 것인지 궁금합니다!📸 스크린샷