-
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/#482] 반응형 헤더 구현 #486
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
LGTM^__^ |
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/components/commons/Header.tsx
Outdated
@@ -119,11 +186,66 @@ export const DefaultHeader = () => { | |||
const { navigateToHome } = useNavigateHome(); | |||
return ( | |||
<HeaderWrapper> | |||
<HeaderLogoIcon onClick={navigateToHome} /> | |||
<HeaderLogoIcon onClick={navigateToHome}></HeaderLogoIcon> |
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) self closing에서 변경해준 이유가 궁금해요 !
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.
오호 이것저것 수정하다가 vscode에서 자동으로 바꾼거 같아요 다시 바꾸겠습니다!
src/components/commons/Header.tsx
Outdated
padding-right: 2rem; | ||
padding-left: 2rem; |
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.
P2) padding: 0 2rem
으로 작성해줄 수 있을 것 같슴다 !
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) MobileSidebar
는 어떠신가요 ?
onClose, | ||
groupCount, | ||
groupData, | ||
}: { | ||
onClose: () => void; | ||
groupCount: number; | ||
groupData: Moim[] | []; |
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) 전달받는 props가 3개인 만큼 인터페이스로 분리해서 작성해주면 가독성이 높아질 것 같습니다 !
const sidebarRef = useRef<HTMLDivElement>(null); | ||
const { navigateToLogin } = useNavigateLoginWithPath(); | ||
|
||
useClickOutside(sidebarRef, () => { | ||
//헤더 이외부분 클릭시 닫히게 | ||
if (sidebarRef.current) onClose(); | ||
}); |
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.
P2) sidebarRef
가 리턴하는 DOM 요소에 지정되어 있지 않아서 해당 코드가 동작하지 않을 것 같은데, 한 번 확인 부탁드릴게요!
ref를 dom요소에 지정해주면 Background로 감싸주지 않아도 괜찮을 것 같아요
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 marginBottom="4.8" /> | ||
<picture> | ||
<source srcSet={groupJoinCongratsWebp} /> | ||
<img src={groupJoinCongratsIlust} /> |
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) alt 속성을 통해 어떤 이미지인지에 대한 설명을 덧붙이면 좋을 것 같습니다 :)
@namdaeun 당니 코드 반영 완료~! |
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.
lgtm 코멘트 몇ㄱㅐ만 확인해주세영
src/components/commons/Header.tsx
Outdated
if (data?.data?.moims) setMoims(data?.data.moims); | ||
}, [data?.data?.moims]); |
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.
p2) 이거 데이터 타고 타고 들어가서 사용하는 것 보다 쿼리에서 받아올 때 moims만 받아오는 건 어떤가요
import styled from '@emotion/styled'; | ||
import { css } from '@emotion/react'; | ||
|
||
const basicCSS = css` |
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)굿이여요
height: 2px; | ||
margin: 0.4rem 0; | ||
|
||
background-color: #eaeaea; |
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.
p1) 얘는 디자인시스템이 없던가요?
height: 100vh; | ||
padding: 1.2rem 1.6rem; | ||
|
||
background-color: white; |
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.
p1) 이것두 theme으로~!
<CreateGroupWrapper> | ||
{currentPage === 'GroupInfoPage' && ( | ||
<CreateGroupInfo | ||
setCurrentPage={setCurrentPage} | ||
groupName={groupName} | ||
setGroupName={setGroupName} | ||
groupInfo={groupInfo} | ||
setGroupInfo={setGroupInfo} | ||
isPublic={isPublic} | ||
setIsPublic={setIsPublic} | ||
topic={topic} | ||
topicTag={topicTag} | ||
topicDesc={topicDesc} | ||
setTopic={setTopic} | ||
setTopicTag={setTopicTag} | ||
setTopicDesc={setTopicDesc} | ||
groupImageView={groupImageView} | ||
setGroupImageView={setGroupImageView} | ||
setImageFile={setImageFile} | ||
/> | ||
)} | ||
{currentPage === 'GroupLeaderInfoPage' && ( | ||
<CreateGroupLeaderInfo | ||
leaderPenName={leaderPenName} | ||
setLeaderPenName={setLeaderPenName} | ||
leaderDesc={leaderDesc} | ||
setIsGroupLeaderValid={setIsGroupLeaderValid} | ||
setLeaderDesc={setLeaderDesc} | ||
isGroupLeaderValid={isGroupLeaderValid} | ||
/> | ||
)} | ||
{currentPage === 'GroupLeaderInfoPage' && ( | ||
<BtnWrapper> | ||
<CreateGroupBtn type="button" onClick={handleShowModal}> | ||
생성하기 | ||
</CreateGroupBtn> | ||
<BackPageBtn type="button" onClick={handleBackBtn}> | ||
뒤로가기 | ||
</BackPageBtn> | ||
</BtnWrapper> | ||
)} |
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.
p2) 여기 다 groupLeaderInfoPage일 때 렌더링하는 거면 한 번에 묶어서 해도 되지 않아요?
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.
글게유..? 이유가 있나요? 바꿔도되는지..~ @ljh0608
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에서 수정 해주실 수 있나요??
@se0jinYoon 서진언니 코리반영 완료 |
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.
고생하셨습니다~
<CreateGroupWrapper> | ||
{currentPage === 'GroupInfoPage' && ( | ||
<CreateGroupInfo | ||
setCurrentPage={setCurrentPage} | ||
groupName={groupName} | ||
setGroupName={setGroupName} | ||
groupInfo={groupInfo} | ||
setGroupInfo={setGroupInfo} | ||
isPublic={isPublic} | ||
setIsPublic={setIsPublic} | ||
topic={topic} | ||
topicTag={topicTag} | ||
topicDesc={topicDesc} | ||
setTopic={setTopic} | ||
setTopicTag={setTopicTag} | ||
setTopicDesc={setTopicDesc} | ||
groupImageView={groupImageView} | ||
setGroupImageView={setGroupImageView} | ||
setImageFile={setImageFile} | ||
/> | ||
)} | ||
{currentPage === 'GroupLeaderInfoPage' && ( | ||
<CreateGroupLeaderInfo | ||
leaderPenName={leaderPenName} | ||
setLeaderPenName={setLeaderPenName} | ||
leaderDesc={leaderDesc} | ||
setIsGroupLeaderValid={setIsGroupLeaderValid} | ||
setLeaderDesc={setLeaderDesc} | ||
isGroupLeaderValid={isGroupLeaderValid} | ||
/> | ||
)} | ||
{currentPage === 'GroupLeaderInfoPage' && ( | ||
<BtnWrapper> | ||
<CreateGroupBtn type="button" onClick={handleShowModal}> | ||
생성하기 | ||
</CreateGroupBtn> | ||
<BackPageBtn type="button" onClick={handleBackBtn}> | ||
뒤로가기 | ||
</BackPageBtn> | ||
</BtnWrapper> | ||
)} |
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에서 수정 해주실 수 있나요??
src/pages/groupFeed/hooks/queries.ts
Outdated
@@ -119,7 +119,9 @@ export const useFetchHeaderGroup = () => { | |||
queryFn: () => fetchHeaderGroup(), | |||
retry: 3, | |||
}); | |||
return { data }; | |||
|
|||
const moimsData = data?.data.moims; |
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) 저번에 비동기 데이터 받아올 때 옵셔널체이닝 모든 상위 객체에 걸어주지 않아서 에러가 발생했던 걸로 기억하는데
data?.data?.moims
로 사용하는거 어떨까요?
if (moimsData && moimsData?.length >= 5) { | ||
handleShowModal(); | ||
} | ||
}, [data?.data.moims.length]); | ||
}, [moimsData?.length]); |
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) 깔끔하네요! 좋습니다~
✨ 해당 이슈 번호 ✨
closed #482
todo
📌 내가 알게 된 부분
에디터 헤더는 서진언니가 했다고 해서 그거 뺴고 3개 했고,
사이드바는 로그인/비로그인 상태 나눠서 2개입니다.
헤더 + 사이드바 영역 바깥 클릭하면 useOutsideClick 이용해서 닫히게 구현했어요
데탑 뷰
내 글 모임
,로그인/로그아웃
,글모임 만들기
버튼들이모바일 뷰에선 사이드바 내로 이동하게 되어서 파일이 아예 달라요.
그래서 공통 버튼으로 빼고, basicCSS 활용해서 HeaderButton으로 분리해뒀습니다.
버튼은 패딩이 일정치 않아서 최소패딩만 통일시키고 width:100%로 잡아서 사이즈 조정했슴니다
📌 질문할 부분
📌스크린샷(선택)
로그인했을 때 헤더
Screen.Recording.2024-12-04.at.10.51.24.PM.mov
로그아웃 헤더
Screen.Recording.2024-12-04.at.10.52.28.PM.mov
관리자페이지 헤더
Screen.Recording.2024-12-04.at.10.53.26.PM.mov