-
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
[#31] 최상위 컨테이너 설정 #33
Conversation
This reverts commit 4653f36. :wq "" "revert"
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.
수고하셨습니다!! 아까 회의한대로 스타일 코드는 따로 분리해두는게 좋을 것 같습니다!
근데 App 같은 경우는 스타일 파일을 별도로 빼는 것 보단, Layout으로 컴포넌트를 따로 빼서 거기서 Container와 Wrapper의 스타일을 지정해주는건 어떨까욤...?
미디어 쿼리보다 max, min-width로 해결하신게 더 좋은 것 같네요! |
<SContainer> | ||
{/* <SHeader/> */} | ||
<SWrapper> | ||
<Outlet /> |
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.
헤더나 푸터가 필요없는 페이지에서는 어떤 방식으로 처리하면 좋을까요?
당장 생각나는 건 헤더와 푸터에서 useLocation으로 주소를 불러와서 필요없는 주소에서는 보이지 않게 하는 방법이 있을 것 같은데, 다른 아이디어도 있는 지 궁금합니다
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.
엇 저도 예전 프로젝트에서 header부분 석민님께서 말씀하신 것처럼 처리했던거 같습니다! 저도 다른 대안은 생각나는건 없네용!
src/App.tsx
Outdated
justify-content: center; | ||
align-items: center; | ||
|
||
background-color: ${(props) => props.theme.color.greyScale6}; |
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.
관련있는 속성끼리 개행 추가하셔서 보기가 더 편한 것 같아요!!
background-color: ${(props) => props.theme.color.greyScale6};
theme 쓸 때, 아래처럼 축약해서 사용도 가능하더라구요. 편하시면 이렇게 사용해도 좋을것 같아요
background-color: ${(theme) => theme.color.greyScale6};
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.
궁금한게 있는데 background-color: ${(theme) => theme.color.greyScale6}; 이렇게 theme을 직접 임포트해서 사용하는 것 과
${({theme}) => theme.color.greyScale6}; 이렇게 ThemeProvider 안에 있는 theme을 사용하는 것과 어떤 차이가 있을까요? 저는 후자로 해왔어서 문득 궁금하네여..
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.
theme을 직접 import 한다는 게 사용하려는 파일에서
import { theme } from "../../styles/theme.ts"
이런 식으로 import해서 사용한다고 말하시는게 맞나요?
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 파일이 직접 임포트 되는걸로 알고 있습니다..!
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.
앗 제가 잘못알았네용 😅
background-color: ${theme.color.greyScale6};
이렇게 사용하는게 직접 임포트되는거구
석민님이 말씀하신 방법은 provider 내의 theme을 사용하는게 맞네용!
이게 직접 임포트해서 사용하는 경우도 봤어서 어떤 차이가 있는지 문득궁금했습니다 ㅋㅋ gpt한테 물어보니 직접 임포트해서 사용하는 경우는 ThemeProvider가 제공하는 컨텍스트에 의존하고 독립적으로 사용할 수 있지만, 테마의 동적 변경이 어렵고, 전역 테마 시스템의 이점을 활용하기 어렵습니다. 라고 하네요..😯
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.
themeProvider에 설정한 값을 가져오는거랑 파일에 직접 접근하는 것의 차이가 있을 것 같네요!
App.styled.ts가 아니라 Layout.ts 파일을 따로 만들자는 얘기실까요?! |
넵넵!.. 헤더와 푸더 같은 경우도 Layout 폴더에서 관리하게 될 것 같아서 |
넵 좋은거 같습니다! component폴더에 layout폴더를 만들어서 반영하겠습니당! |
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.
layout으로 분리하니 더 깔끔하네요...
최상위 스타일 컴포넌트 잡아주셔서 감사합니다!
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.
👍
Issue Number
close #31
⛳️ Task
✍️ Note & 📸 Screenshot
1. 최상위 container(브라우저 전체 너비)와 최상위 wrapper(360~768px) 설정
2. header와 footer의 자리를 남김
UX디자이너분과 상의해봐야하겠지만 타서비스를 볼 때 헤더와 푸터가 실제 page contents 영역과 다르게 설정되어있는 경우가 많은거 같습니다.
야놀자의 경우, header와 footer가 브라우저 전체 폭까지 늘어나있지만 실제 content는 최대 768px의 제한을 받고 있습니다. (https://www.yanolja.com/)
App.tsx에 SHeader와 SFooter를 주석처리해놓았는데 실제 header를 넣으면 이렇게 보입니다. (진한 회색이 header영역)
2024-01-03.11.29.08.mov
내일 헤더 부분에 대해서 UX디자이너 분과 이야기 해보고 독립시킬지 아니면 360~768px에 헤더/푸터도 다 넣을지 의논해보고 결정하겠습니다!
1/4 11시
component/layout/index.ts
에 정리하였습니다.