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/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..325d4d12 100644 --- a/apps/web/src/app/university/page.tsx +++ b/apps/web/src/app/university/page.tsx @@ -19,12 +19,9 @@ const UniversityOnboardingPage = () => { return ( <> -
-

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

-

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

- +
+

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

+

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

{HOME_UNIVERSITIES.map((university) => ( diff --git a/apps/web/src/components/university/UniversityCards/index.tsx b/apps/web/src/components/university/UniversityCards/index.tsx index 81b48417..16905aa1 100644 --- a/apps/web/src/components/university/UniversityCards/index.tsx +++ b/apps/web/src/components/university/UniversityCards/index.tsx @@ -1,9 +1,6 @@ "use client"; -import { useVirtualizer } from "@tanstack/react-virtual"; - import clsx from "clsx"; -import { useRef } from "react"; import type { ListUniversity } from "@/types/university"; import UniversityCard from "../../ui/UniverSityCard"; @@ -13,69 +10,16 @@ type UniversityCardsProps = { style?: React.CSSProperties; className?: string; showCapacity?: boolean; - enableVirtualization?: boolean; }; -const ITEM_HEIGHT = 101; - -const UniversityCards = ({ - colleges, - style, - className, - showCapacity = true, - enableVirtualization = true, -}: UniversityCardsProps) => { - // 훅은 항상 컴포넌트 상단에서 호출해야 함 (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) => ( -
- -
- ))} -
- ); - } - - // 가상화 사용 +const UniversityCards = ({ colleges, style, className, showCapacity = true }: UniversityCardsProps) => { 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; + } + }, }, ), );