-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from alkong-dalkong/feature/#142_HomePage
refactor: Home 페이지 컨벤션에 맞게 리펙토링
- Loading branch information
Showing
9 changed files
with
32 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,3 @@ export const api = new HttpClient({ | |
}) | ||
|
||
export * from './auth' | ||
export * from './home' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import { HomePage } from '@/features' | ||
import { HomeClientPage } from '@/features' | ||
|
||
export type HomeRouteParams = { | ||
params: { userId: string } | ||
} | ||
|
||
const Home = ({ params: { userId } }: HomeRouteParams) => { | ||
return <HomePage userId={userId} /> | ||
const Home = () => { | ||
return <HomeClientPage /> | ||
} | ||
|
||
export default Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const homeQueryKeys = { | ||
all: ['home'] as const, | ||
user: (userId: string) => [...homeQueryKeys.all, userId], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client' | ||
|
||
import { useParams } from 'next/navigation' | ||
import { useQuery } from '@tanstack/react-query' | ||
|
||
import { getHomePageData, homeQueryKeys } from '@/features' | ||
import type { HomeResponseType } from '@/types' | ||
|
||
export const useFetchHome = () => { | ||
const { userId } = useParams<{ userId: string }>() | ||
|
||
return useQuery<HomeResponseType>({ | ||
queryKey: homeQueryKeys.user(userId), | ||
queryFn: () => getHomePageData(userId), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.