From bc366411c2f3a02a53b5d8b97b60c8a3587fb162 Mon Sep 17 00:00:00 2001 From: manNomi Date: Tue, 27 Jan 2026 01:39:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EB=8C=80=ED=95=99=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20=EB=A9=98=ED=86=A0=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=AC=B4=ED=95=9C=20=EC=8A=A4=ED=94=BC=EB=84=88=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 대학 목록 가상화 제거 및 전체 페이지 스크롤 적용 - 검색바 스티키 고정 및 검색 시 현재 경로 유지하도록 수정 - authStore 초기화(hydration) 후 isInitialized 상태 업데이트 로직 추가 - 대학 페이지 레이아웃 및 문구 수정 --- apps/web/src/app/university/SearchBar.tsx | 10 +-- .../SearchResultsContent.tsx | 2 +- .../list/[homeUniversityName]/page.tsx | 4 +- apps/web/src/app/university/page.tsx | 23 ++++--- .../university/UniversityCards/index.tsx | 63 ++----------------- apps/web/src/lib/zustand/useAuthStore.ts | 6 ++ 6 files changed, 31 insertions(+), 77 deletions(-) diff --git a/apps/web/src/app/university/SearchBar.tsx b/apps/web/src/app/university/SearchBar.tsx index 074ea073..bfd12b6d 100644 --- a/apps/web/src/app/university/SearchBar.tsx +++ b/apps/web/src/app/university/SearchBar.tsx @@ -1,7 +1,7 @@ "use client"; import { zodResolver } from "@hookform/resolvers/zod"; -import { useRouter } from "next/navigation"; +import { usePathname, useRouter } from "next/navigation"; import { type SubmitHandler, useForm } from "react-hook-form"; import { z } from "zod"; @@ -27,6 +27,7 @@ interface SearchBarProps { // --- 폼 로직을 관리하는 부모 컴포넌트 --- const SearchForm = ({ initText }: SearchBarProps) => { const router = useRouter(); + const pathname = usePathname(); const { register, @@ -48,12 +49,13 @@ const SearchForm = ({ initText }: SearchBarProps) => { const queryString = queryParams.toString(); - router.push(`/university?${queryString}`); + // 현재 경로에서 쿼리 파라미터만 업데이트 + router.push(`${pathname}?${queryString}`); }; return ( -
-
+ +
+
{/* 지역 필터 */} diff --git a/apps/web/src/app/university/list/[homeUniversityName]/page.tsx b/apps/web/src/app/university/list/[homeUniversityName]/page.tsx index 8d1e550f..3c370544 100644 --- a/apps/web/src/app/university/list/[homeUniversityName]/page.tsx +++ b/apps/web/src/app/university/list/[homeUniversityName]/page.tsx @@ -49,9 +49,7 @@ const UniversityListPage = async ({ params }: PageProps) => { return ( <> -
- -
+ ); }; diff --git a/apps/web/src/app/university/page.tsx b/apps/web/src/app/university/page.tsx index cb02aa6e..6bfa923b 100644 --- a/apps/web/src/app/university/page.tsx +++ b/apps/web/src/app/university/page.tsx @@ -19,18 +19,17 @@ const UniversityOnboardingPage = () => { return ( <> -
-

파견 대학교를 선택해주세요

-

- 소속 대학교를 선택하면 해당 대학교의 교환학생 파견 정보를 확인할 수 있습니다. -

- -
- {HOME_UNIVERSITIES.map((university) => ( - -
-
-
+
+

출신 학교 정보를 선택해주세요

+

+ 해당 학교에서 제공되는 교환학생 파견 정보를 확인할 수 있습니다. +

+
+ {HOME_UNIVERSITIES.map((university) => ( + +
+
+
{ - // 훅은 항상 컴포넌트 상단에서 호출해야 함 (React Hooks 규칙) - const parentRef = useRef(null); - - const virtualizer = useVirtualizer({ - count: colleges.length, - getScrollElement: () => parentRef.current, - estimateSize: () => ITEM_HEIGHT, - overscan: 5, - }); - - // 가상화가 비활성화된 경우 일반 렌더링 - if (!enableVirtualization) { - return ( -
- {colleges.map((college) => ( -
- -
- ))} -
- ); - } - - // 가상화 사용 return ( -
-
- {virtualizer.getVirtualItems().map((virtualItem) => ( -
-
- -
-
- ))} -
+
+ {colleges.map((college) => ( +
+ +
+ ))}
); }; diff --git a/apps/web/src/lib/zustand/useAuthStore.ts b/apps/web/src/lib/zustand/useAuthStore.ts index 2cbdc397..e7de5c47 100644 --- a/apps/web/src/lib/zustand/useAuthStore.ts +++ b/apps/web/src/lib/zustand/useAuthStore.ts @@ -63,6 +63,12 @@ const useAuthStore = create()( accessToken: state.accessToken, isAuthenticated: state.isAuthenticated, }), + onRehydrateStorage: () => (state) => { + // hydration 완료 후 isInitialized를 true로 설정 + if (state) { + state.isInitialized = true; + } + }, }, ), ); From 57559f1aef336b1fa7cac4965a44891bdfae104e Mon Sep 17 00:00:00 2001 From: manNomi Date: Tue, 27 Jan 2026 01:44:30 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20university=20cards=20prop=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20lint=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - university list에서 제거된 enable virtualization prop 사용 제거 - biome lint 자동 수정 적용 --- .../app/(home)/_ui/UniversityList/index.tsx | 2 +- apps/web/src/app/university/page.tsx | 18 ++++++++---------- .../university/UniversityCards/index.tsx | 7 +------ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/apps/web/src/app/(home)/_ui/UniversityList/index.tsx b/apps/web/src/app/(home)/_ui/UniversityList/index.tsx index 6a891221..5722b8ab 100644 --- a/apps/web/src/app/(home)/_ui/UniversityList/index.tsx +++ b/apps/web/src/app/(home)/_ui/UniversityList/index.tsx @@ -47,7 +47,7 @@ const UniversityList = ({ allRegionsUniversityList }: UniversityListProps) => { background: "white", }} /> - +
); }; diff --git a/apps/web/src/app/university/page.tsx b/apps/web/src/app/university/page.tsx index 6bfa923b..325d4d12 100644 --- a/apps/web/src/app/university/page.tsx +++ b/apps/web/src/app/university/page.tsx @@ -20,16 +20,14 @@ const UniversityOnboardingPage = () => { <>
-

출신 학교 정보를 선택해주세요

-

- 해당 학교에서 제공되는 교환학생 파견 정보를 확인할 수 있습니다. -

-
- {HOME_UNIVERSITIES.map((university) => ( - -
-
-
+

출신 학교 정보를 선택해주세요

+

해당 학교에서 제공되는 교환학생 파견 정보를 확인할 수 있습니다.

+
+ {HOME_UNIVERSITIES.map((university) => ( + +
+
+
{ +const UniversityCards = ({ colleges, style, className, showCapacity = true }: UniversityCardsProps) => { return (
{colleges.map((college) => (