Skip to content
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

Merged
merged 25 commits into from
Dec 17, 2024
Merged

Conversation

moondda
Copy link
Contributor

@moondda moondda commented Dec 4, 2024

✨ 해당 이슈 번호 ✨

closed #482

todo

  • 반응형 헤더 작업

📌 내가 알게 된 부분

Screenshot 2024-12-04 at 10 43 42 PM

에디터 헤더는 서진언니가 했다고 해서 그거 뺴고 3개 했고,
Screenshot 2024-12-04 at 10 44 41 PM
사이드바는 로그인/비로그인 상태 나눠서 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

@moondda moondda self-assigned this Dec 4, 2024
Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mile-client ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 10:02am

@moondda moondda added ✨ Feature 새로운 기능 추가 (새로운 구현) 다현 labels Dec 4, 2024
@github-actions github-actions bot added the size/l size/l label Dec 4, 2024
@eastlaw80
Copy link
Contributor

LGTM^__^

Copy link
Member

@namdaeun namdaeun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헤더 구현 고생하셨습니다 !! 잘 사용해볼게유 ✨👍🏻

@@ -119,11 +186,66 @@ export const DefaultHeader = () => {
const { navigateToHome } = useNavigateHome();
return (
<HeaderWrapper>
<HeaderLogoIcon onClick={navigateToHome} />
<HeaderLogoIcon onClick={navigateToHome}></HeaderLogoIcon>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3) self closing에서 변경해준 이유가 궁금해요 !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 이것저것 수정하다가 vscode에서 자동으로 바꾼거 같아요 다시 바꾸겠습니다!

Comment on lines 267 to 268
padding-right: 2rem;
padding-left: 2rem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2) padding: 0 2rem 으로 작성해줄 수 있을 것 같슴다 !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3) MobileSidebar는 어떠신가요 ?

Comment on lines 33 to 39
onClose,
groupCount,
groupData,
}: {
onClose: () => void;
groupCount: number;
groupData: Moim[] | [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3) 전달받는 props가 3개인 만큼 인터페이스로 분리해서 작성해주면 가독성이 높아질 것 같습니다 !

Comment on lines 14 to 20
const sidebarRef = useRef<HTMLDivElement>(null);
const { navigateToLogin } = useNavigateLoginWithPath();

useClickOutside(sidebarRef, () => {
//헤더 이외부분 클릭시 닫히게
if (sidebarRef.current) onClose();
});
Copy link
Member

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로 감싸주지 않아도 괜찮을 것 같아요

Copy link
Contributor Author

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} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3) alt 속성을 통해 어떤 이미지인지에 대한 설명을 덧붙이면 좋을 것 같습니다 :)

@moondda
Copy link
Contributor Author

moondda commented Dec 6, 2024

@namdaeun 당니 코드 반영 완료~!

Copy link
Contributor

@se0jinYoon se0jinYoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 코멘트 몇ㄱㅐ만 확인해주세영

Comment on lines 209 to 210
if (data?.data?.moims) setMoims(data?.data.moims);
}, [data?.data?.moims]);
Copy link
Contributor

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`
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p1) 이것두 theme으로~!

Comment on lines 159 to 199
<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>
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) 여기 다 groupLeaderInfoPage일 때 렌더링하는 거면 한 번에 묶어서 해도 되지 않아요?

Copy link
Contributor Author

@moondda moondda Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

글게유..? 이유가 있나요? 바꿔도되는지..~ @ljh0608

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 그런것 같네요 이 PR에서 수정 해주실 수 있나요??

@moondda
Copy link
Contributor Author

moondda commented Dec 6, 2024

@se0jinYoon 서진언니 코리반영 완료

Copy link
Member

@ljh0608 ljh0608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~

Comment on lines 159 to 199
<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>
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 그런것 같네요 이 PR에서 수정 해주실 수 있나요??

@@ -119,7 +119,9 @@ export const useFetchHeaderGroup = () => {
queryFn: () => fetchHeaderGroup(),
retry: 3,
});
return { data };

const moimsData = data?.data.moims;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3) 저번에 비동기 데이터 받아올 때 옵셔널체이닝 모든 상위 객체에 걸어주지 않아서 에러가 발생했던 걸로 기억하는데

data?.data?.moims 

로 사용하는거 어떨까요?

Comment on lines +56 to +59
if (moimsData && moimsData?.length >= 5) {
handleShowModal();
}
}, [data?.data.moims.length]);
}, [moimsData?.length]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5) 깔끔하네요! 좋습니다~

@moondda moondda merged commit 6044156 into develop Dec 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 새로운 기능 추가 (새로운 구현) size/l size/l 다현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ Feat ] 반응형 헤더 작업
5 participants