-
Notifications
You must be signed in to change notification settings - Fork 7
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
[SP2] blog tab navigation #228
Conversation
…pt-makers/sopt.org-frontend into feat/#218-blog-tab-navigation
@@ -0,0 +1 @@ | |||
export { default } from '@src/views/BlogPage'; |
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.
/blog 로 접속하면 해당 페이지입니다!
@@ -4,7 +4,7 @@ import { mainColor } from '@src/lib/styles/colors'; | |||
export const Root = styled.footer` | |||
width: 100%; | |||
min-height: 162px; | |||
background-color: #2a2a2a; | |||
background-color: #17171c; |
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.
요 컬러는 mds에 없어서...! 색상코드를 넣었습니다! pd에게 다시 확인하고 커밋해둘게요!
@@ -8,19 +8,20 @@ | |||
justify-content: center; | |||
align-items: center; | |||
position: fixed; | |||
background-color: rgba(22, 22, 28, 0.9); | |||
background-color: #0f0f12; |
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.
scss 파일에서 color 코드를 불러오려는데
./src/components/Header/header.module.scss
SassError: Can't find stylesheet to import.
╷
2 │ @import '@src/lib/styles/colors.ts';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
src/components/Header/header.module.scss 2:9 root stylesheet
이러한 에러가 계속 떠서 아예 styled-component를 통일하게 사용하도록 style.ts
로 바꿨습니다!
@@ -12,20 +12,9 @@ export const menuTapList: MenuTapList = [ | |||
href: '/project', | |||
}, | |||
{ | |||
type: MenuTapType.Parent, | |||
type: MenuTapType.Router, |
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.
좋네용.. 사실 이제 MenuTapType.Anchor 도 사라지긴 해서 type 이라는 친구도 없어도 되긴 혀요
다른 것이 추가될 수도 있으니 살려두어도 괜찮을 것 같습니당
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.
MenuTapType.Anchor 도 지울까 했는데,,, 일단 살려뒀습니다!
src/lib/styles/colors.ts
Outdated
gray500: '#515159', | ||
gray600: '#3F3F47', | ||
gray700: '#2E2E35', | ||
gray800: '#202025', | ||
gray900: '#0F0F12', |
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.
최신 브랜치를 머지해주쎄용~!!
title: string; | ||
description: string; |
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.
- title, description 도 하나의 타입으로 빼면 좋을 것 같습니당
- 이름이 list인데 리스트가 �아니고 오브젝트네용..
- 저 같은 경우에는 이렇게 쓰는 것을 선호합니다!!!! but. .. 혹시 REVIEW와 ARTICLE이 담는 컨텐츠가 달라질 것을 예상하고 이렇게 작성하신 거라면 이대로도 좋아요~~
enum BlogTabType = {
REVIEW='review',
ARTICLE='article'
}
type BlogTabContent = {
title: string;
description: string;
}
type BlogTabMap = Record<BlogTabType, BlogTabContent>;
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.
의견 감사합니다! 일단 저렇게 타입을 쓴 이유는
나중에 드롭다운에 들어갈 내용 (label)을 같이 관리할 수 있지 않을까 싶어서 입니다!
두 탭의 내용과 타입이 달라질 수 도 있으니까요. 드롭다운 기능까지 붙이고 나서는 서진의 의견대로 통일할 건 통일하면 좋을 것 같네요!!
|
||
cursor: pointer; | ||
position: relative; | ||
border-bottom: ${({ isSelected }) => isSelected && `2px solid ${colors.gray200}`}; |
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.
피그마 상에서 클릭시 이벤트에만 색상이 부여되어있어요!
width: 100%; | ||
} | ||
/* 모바일 뷰 */ | ||
@media (max-width: 767px) { |
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.
합치겠습니당!
…pt-makers/sopt.org-frontend into feat/#218-blog-tab-navigation
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/views/BlogPage/BlogPage.tsx
Outdated
import PageLayout from '@src/components/common/PageLayout'; | ||
import Navigation from './components/navigation'; | ||
|
||
export default function BlogPage() { | ||
return ( | ||
<PageLayout> | ||
<Navigation /> | ||
</PageLayout> | ||
); | ||
} |
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.
suggestion;
해당 코드를 pages/blog
컴포넌트에 바로 작성하는 건 어떨까요? 앞으로는 기존 구조 대신 페이지 컴포넌트 내에 바로 작성하는 것을 제안드립니다.
[제안 이유]
views/BlogPage/BlogPage
->views/BlogPage/index
->pages/blog
에 re-export하는 과정이 복잡하고 불필요하게 느껴진다. (위 구조를 취해야 하는 이유를 모르겠음)- 페이지 컴포넌트 내에서만 사용할 수 있는 함수를 사용하기 어렵다.
@SeojinSeojin @f0rever0 다들 어떻게 생각하시나요?
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.
사실 저도 이번에 og 버그를 잡으면서 SSR을 위해서 re-export를 하던 구조를 깨버렸기 때문에...
논의를 다시 했으면 했어요!
다만 이번에 작업 시간이 빠듯하다보니까 미뤄뒀었는데, 혜준언니가 말해준거에 동감하는 바입니다!
import * as S from './style'; | ||
import { BlogTabList } from './types'; | ||
|
||
export default function Navigation() { |
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.
suggestion;
Navigation
이라는 이름 보다는 BlogTap
과 같은 이름을 사용하는 게 어떨까요?
네비게이션은 서로 연관이 없는 별도의 데이터를 이동하는 느낌이라면 탭은 서로 연관이 있는 데이터를 구분하는 데 사용하는 느낌인 것 같아서요. [참고]
또한, 개인적으로는 작성하신 컴포넌트 내의 상수나 스타일 컴포넌트명을 고려했을 때 Tap이 더 적절하다고 느껴집니다!
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.
레퍼런스까지 감사합니다! tab 네이밍이 더 적절하겠군요!
|
||
cursor: pointer; | ||
position: relative; | ||
border-bottom: ${({ isSelected }) => isSelected && `2px solid ${colors.gray200}`}; |
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.
위처럼 && 연산자를 사용했을 때 falsy한 값이 반환됐을 때도 정상 작동하는 이유가 궁금해서 찾아봤는데 스타일 컴포넌트가 falsy한 값으로 평가되는 보간을 css로 바꿀 때 무시하는 것 같네요. [레퍼런스]
@solar3070 2023-10-21.10.08.35.mov |
제가 잘못 확인했던 거였네요......! 번거롭게 해드려서 죄송해요 😓 잘 동작합니다! |
import { BlogTabList } from './types'; | ||
|
||
export default function BlogTab() { | ||
const [selectTab, setSelectTab] = useState<keyof BlogTabList>('REVIEW'); |
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.
suggestion;
상태명 selectedTap
은 어떨까요?
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.
문법적으로 selectedTap 가 더 적절하겠네요. 수정하겠습니다!
REVIEW: { | ||
title: '활동후기', | ||
description: '회원들의 진솔한 후기를 통해 SOPT를 미리 만나보세요. ', | ||
}, | ||
ARTICLE: { | ||
title: '아티클', | ||
description: '회원들의 아티클을 통해 SOPT에서 얻은 인사이트를 확인해보세요.', | ||
}, |
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.
ask;
key 이름 대문자로 하신 이유가 궁금합니다!
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.
key값은 고유하니까, 고유한 상수값은 대문자로 표기했어요!
Summary
Screenshot
[헤더]
[블로그]
ezgif.com-gif-maker.mov
Comment
드롭다운은 서진이 작업물 머지하고 새로 이슈파서 작업할게요!