From 4c6f95d4c03ee93b7cbd7d17801454f45249e089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=82=98=ED=98=84?= <142777396+Nahyun-Kang@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:40:32 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20=ED=99=88(=EA=B5=AC=20=ED=83=90?= =?UTF-8?q?=EC=83=89)=20=EA=B0=9C=ED=8E=B8=20(#263)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Feat: 홈 폴더 및 페이지 생성 * Design: 추천 리스터 css 수정 * Feat: 헤더 컴포넌트 생성 * Feat: 헤더 퍼블리싱 완료 * Feat: 트렌딩리스트 수정 * Feat: 주제 요청하기 버튼 만들기 * Feat: 헤더 로직 구현 * Feat: 최신 리스트 수정 * Feat: 팔로잉 리스트 구현 완료 * Fix: cherrypick 과정에서 뜨는 오류 해결 및 floating 버튼 삭제 * Fix: 빌드 에러 해결 * Fix: 빌드에러 수정 * Fix: 코드리뷰 반영 * Fix: 헤더 오류 해결 --- src/app/(home)/_components/FeedLists.css.ts | 10 +- src/app/(home)/_components/Header.tsx | 8 +- src/app/(home)/_components/HomeTab.tsx | 19 +- .../(home)/_components/__TrendingLists.css.ts | 187 ++++++++++++++++++ src/app/(home)/layout.tsx | 7 - src/components/Header/Header.tsx | 2 +- 6 files changed, 202 insertions(+), 31 deletions(-) create mode 100644 src/app/(home)/_components/__TrendingLists.css.ts diff --git a/src/app/(home)/_components/FeedLists.css.ts b/src/app/(home)/_components/FeedLists.css.ts index 70e54f0e..81f6e396 100644 --- a/src/app/(home)/_components/FeedLists.css.ts +++ b/src/app/(home)/_components/FeedLists.css.ts @@ -1,6 +1,5 @@ import { style, createVar, keyframes } from '@vanilla-extract/css'; import { vars } from '@/styles/__theme.css'; -import { headlineSmall } from '@/styles/__font.css'; export const listBackground = createVar(); @@ -20,12 +19,9 @@ export const titleWrapper = style({ gap: '5px', }); -export const sectionTitle = style([ - headlineSmall, - { - fontWeight: 600, - }, -]); +export const sectionTitle = style({ + fontWeight: 600, +}); const listWrapperHoverAnimation = keyframes({ '0%': { diff --git a/src/app/(home)/_components/Header.tsx b/src/app/(home)/_components/Header.tsx index 80fda046..eba521c9 100644 --- a/src/app/(home)/_components/Header.tsx +++ b/src/app/(home)/_components/Header.tsx @@ -24,9 +24,9 @@ import BellIcon from '/public/icons/ver3/bell.svg'; import Avatar from '/public/icons/ver3/Avatar.svg'; function Header() { - const [isSearchBarOpened, setIsSearchBarOpened] = useState(false); + const { isOn: isSearchBarOpened, handleSetOn: handleSearchBarOpened } = useBooleanOutput(); const { isOn, handleSetOn, handleSetOff } = useBooleanOutput(); - const [isLoggedIn, setIsLoggedIn] = useState(false); + const [isLoggedIn, setIsLoggedIn] = useState(false); // 로그인 상태를 관리하는 useState 추가 const { user } = useUser(); @@ -41,11 +41,11 @@ function Header() { }; const handleInactivateSearchBar = () => { - setIsSearchBarOpened(false); + handleSearchBarOpened(); }; const handleSearchIconClick = () => { - setIsSearchBarOpened(true); + handleSearchBarOpened(); }; useEffect(() => { diff --git a/src/app/(home)/_components/HomeTab.tsx b/src/app/(home)/_components/HomeTab.tsx index 7978dbcf..2c5f7d68 100644 --- a/src/app/(home)/_components/HomeTab.tsx +++ b/src/app/(home)/_components/HomeTab.tsx @@ -7,25 +7,20 @@ import * as styles from './HomeTab.css'; function HomeTab() { const { currentTab, setCurrentTab } = useTab(); + const getButtonStyle = (selectedTap: string) => { + return currentTab === selectedTap ? styles.activeTab : styles.tabButton; + }; + return (