diff --git a/src/app/page.tsx b/src/app/page.tsx index 967055d1..13c1108f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,8 +7,18 @@ import { GetGroupsResponse } from '@/types/service/group'; export const dynamic = 'force-dynamic'; -export default async function HomePage() { - const response = await API.groupService.getGroups({ size: GROUP_LIST_PAGE_SIZE }); +interface HomePageProps { + searchParams: Promise<{ keyword?: string }>; +} + +export default async function HomePage({ searchParams }: HomePageProps) { + const params = await searchParams; + const keyword = params.keyword; + + const response = await API.groupService.getGroups({ + size: GROUP_LIST_PAGE_SIZE, + keyword, + }); // React Query의 useInfiniteQuery에 맞는 initialData 형태로 변환 const initialData: InfiniteData = { @@ -17,5 +27,5 @@ export default async function HomePage() { }; // 초기 데이터를 전달해서 무한 스크롤 시작 - return ; + return ; } diff --git a/src/components/layout/header/index.tsx b/src/components/layout/header/index.tsx index 71932124..a1620263 100644 --- a/src/components/layout/header/index.tsx +++ b/src/components/layout/header/index.tsx @@ -1,11 +1,22 @@ +'use client'; + import Link from 'next/link'; +import { usePathname } from 'next/navigation'; import { Icon } from '@/components/icon'; -export const Header = () => { +type HeaderProps = { + heightClass?: string; + searchBar?: React.ReactNode; +}; + +export const Header = ({ heightClass = 'h-14', searchBar }: HeaderProps) => { + const pathname = usePathname(); + const isRootPage = pathname === '/'; + return ( -
-