-
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 : 공통 컴포넌트 - Header 구현 #7
Conversation
<div> | ||
<Header | ||
leftNode={<h4>PosePicker</h4>} | ||
rightNode={<Image src="/icons/menu.svg" width={24} height={24} alt="24" />} |
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.
혹시 아이콘 에셋 경로 상수로 관리하실 의향이 있으시다면....!
#8 참고해 주세욥..!
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 머지 후에 반영할게요 !
{tabData.map((item) => ( | ||
<div key={item.path}> | ||
{item.path === path ? ( | ||
<> | ||
<div className="py-12"> | ||
<h5 className="text-brand">{item.title}</h5> | ||
</div> | ||
<div className="border-b-main-violet relative top-0.5 border-b-2" /> | ||
<div className="relative top-0.5 border-b-2 border-b-main-violet" /> |
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.
엇 제 vsc에서는 tailwind 속성들을 자동으로 정렬해주는데 규성님과 순서가 다른 것 같아요..! 세팅 차이인지 확인해봐야할 것 같습니담
@@ -13,15 +13,15 @@ export default function Tab() { | |||
const path = usePathname(); | |||
|
|||
return ( | |||
<nav className="flex items-center gap-16"> | |||
<nav className="fixed inset-x-0 top-64 mx-auto flex h-48 items-center gap-16 border-b-2 border-b-divider px-20"> |
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.
inset-x-0 ...! 배워갑니다 //
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 MainLayout({ children }: StrictPropsWithChildren) { | ||
return ( | ||
<> | ||
<Spacing size={140} /> |
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.
만들어주신 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.
여백을 추가하고 싶을 때 선언적으로 줄 수 있는 컴포넌트입니다.
물론 각 컴포넌트마다 className="mt-5"
로 여백을 추가할 수 있지만, 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.
좋은 아이디어 같아요 fixed 된 컴포넌트 때문에 계속 padding 값 신경쓰는게 낭비라고 생각했는데 깔끔한 방법이 있었네요 ㅎㅎ
@@ -1,3 +1,3 @@ | |||
export default function Pick() { | |||
return <>포즈픽</>; | |||
return <>포즈픽s</>; |
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.
?0?
export default function SubLayout({ children }: StrictPropsWithChildren) { | ||
return ( | ||
<div> | ||
<Spacing size={100} /> |
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.
상위 div에 padding을 적용하는 것과의 차이는 어떤게 있을지 궁금합니다아
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.
위에 작성한 커멘트 참고해주세용
leftNode?: React.ReactNode; | ||
rightNode?: React.ReactNode; | ||
className?: string; | ||
props?: PropsWithChildren<HTMLAttributes<HTMLHeadElement>>; |
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들은 받아올 수 있는걸로 아는데 아닌걸까요 ?!
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 본문 내용 확인해주세용
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.
임의로 만드신거라고 생각했는데 검색해보니 많이 사용되는 타입이였네요!
덕분에 알아가네요 감사합니다
폴더구조 변경이 #8 머지할때 충돌날 것 같네욤..! 본 PR 머지하고 리졸브하겠습니다! |
💡 왜 PR을 올렸나요?
💁 무엇이 어떻게 바뀌나요?
1. 각 페이지별 Header의 구현하였습니다.
Header
는 leftNode와 rightNode를 받습니다.Header
를 이용하여 커스텀하여 사용할 수 있습니다.2. 폴더 구조를 수정하였습니다.
(Main)/components
에 공통 Header를 만들었습니다.3. 각 컴포넌트 및 타입을 구현하였습니다.
StrictPropsWithChildren
: children의 타입을 강제함으로써 엄격하게 타입 체크를 하도록 하였습니다.📆 작업 예정인 것이 있나요 ?
💬 리뷰어분들께
폴더 구조를 고민하다가 Route Group을 이용하여 짜보았습니다.
혹시 더 좋은 방법이 있으시면 언제든지 말씀해주세요 ! 환영입니다 :)