-
Notifications
You must be signed in to change notification settings - Fork 6
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: 홈(구 탐색) 개편 #263
Feat: 홈(구 탐색) 개편 #263
Conversation
@Nahyun-Kang is attempting to deploy a commit to the Eujin Ahn's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
나현님, Ver3.0 홈 디자인 너무 예쁘네요 🥹✨ 기존과는 전혀 다른 디자인으로 리팩토링 해주셔서 감사합니다👍 더불어 코드도 잘 확인하였습니다. 💕
const [isSearchBarOpened, setIsSearchBarOpened] = useState(false); | ||
const { isOn, handleSetOn, handleSetOff } = useBooleanOutput(); | ||
const [isLoggedIn, setIsLoggedIn] = useState(false); // 로그인 상태를 관리하는 useState 추가 | ||
|
||
const { user } = useUser(); | ||
|
||
const { data: userData } = useQuery<UserType>({ | ||
queryKey: [QUERY_KEYS.userOne, user.id], | ||
queryFn: () => getUserOne(user.id as number), | ||
enabled: !!user.id, | ||
}); | ||
|
||
const handleAuthButtonClick = () => { | ||
handleSetOn(); | ||
}; | ||
|
||
const handleInactivateSearchBar = () => { | ||
setIsSearchBarOpened(false); | ||
}; | ||
|
||
const handleSearchIconClick = () => { | ||
setIsSearchBarOpened(true); | ||
}; | ||
|
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.
검색바 오픈 상태를 관리하는 부분도 hook useBooleanOutput
을 사용해서 리팩토링하면 좋을 것 같아요.
const { isOn: isSearchBarOpened , handleSetOn: handleSearchBarOpened, handleSetOff: handleSetSearchBarClosed } = useBooleanOutput();
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.
항상 더 나은 대안을 주셔서 너무 감사합니다...
<button | ||
onClick={() => setCurrentTab('recommendation')} | ||
className={currentTab === 'recommendation' ? `${styles.activeTab}` : `${styles.tabButton}`} | ||
> | ||
추천 | ||
</button> | ||
<button | ||
onClick={() => setCurrentTab('recent')} | ||
className={currentTab === 'recent' ? `${styles.activeTab}` : `${styles.tabButton}`} | ||
> | ||
최신 | ||
</button> | ||
<button | ||
onClick={() => setCurrentTab('following')} | ||
className={currentTab === 'following' ? `${styles.activeTab}` : `${styles.tabButton}`} | ||
> |
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.
선택된 탭에 따른 스타일 적용하는 부분은 따로 함수로 빼두면 좋을 것 같아요.
// 탭 스타일을 정하는 함수
const getButtonStyle = (selectedTap: string) => {
return currentTab === selectedTap ? styles.activeTab : styles.tabButton;
};
// 사용
<button onClick={() => setCurrentTab('recommendation')} className={getButtonStyle('recommendation')}>
</button>
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.
헙 대박....훨씬 깔끔하네요 ㅠㅠ 감사합니다..!
개요
작업 사항
참고 사항 (optional)
[남은 작업]
@kanglocal 현지님 검색 바 받아서 제가 추가하겠습니다!
관련 이슈 (optional)
스크린샷
홈 > 추천

홈 > 최신

홈 > 팔로잉
리뷰어에게