-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45b8df8
commit 481b7fa
Showing
14 changed files
with
213 additions
and
88 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
"use client"; | ||
import PostCardList from "@/components/post/PostCardList"; | ||
// import { getPostListQueryFn } from "@/queries/post/useGetPostListQuery"; | ||
import { Container } from "@mui/material"; | ||
import { Suspense } from "react"; | ||
|
||
export default function Home() { | ||
// const initialData = await getPostListQueryFn(); | ||
return ( | ||
<Container sx={{ px: { xs: 0, sm: 4 } }} maxWidth={"lg"}> | ||
<PostCardList /> | ||
<Suspense fallback={<>로딩중</>}> | ||
{/* FIXME */}{/* @ts-ignore*/} | ||
<PostCardList | ||
// initialData={initialData} | ||
/> | ||
</Suspense> | ||
</Container> | ||
); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
client/src/components/queryClient/CustomQueryClientProvider.tsx
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 { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
import { ReactNode, useState } from "react"; | ||
|
||
export default function CustomQueryClientProvider({ | ||
children, | ||
}: { | ||
children?: ReactNode; | ||
}) { | ||
const [queryClient] = useState(() => new QueryClient()); | ||
|
||
return ( | ||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
); | ||
} |
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,38 +1,6 @@ | ||
import { HttpResponse, http } from "msw"; | ||
import { randomNumber, randomSelect } from "./utils/random"; | ||
import { PostInterface } from "@/types/post/PostInterface"; | ||
import getPostList from "./handlers/getPostList"; | ||
import getPostDetail from "./handlers/getPostDetail"; | ||
|
||
export const handlers = [ | ||
http.get(`${process.env.NEXT_PUBLIC_BASE_URL}/posts`, () => { | ||
return HttpResponse.json({ | ||
content: Array.from(new Array(5)).map((_data, i):PostInterface => { | ||
return { | ||
nickname: "testNick", | ||
id: "userID", | ||
updateDt: "2023-11-08T13:05:09.531Z", | ||
createdAt: "2023-11-08T13:05:09.531Z", | ||
edited: randomSelect<boolean>(true, false), | ||
postNo: i, | ||
postContent: | ||
"Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eos ullam aut minus aliquam quis officia, non dolore omnis, magnam totam tenetur ad harum? Mollitia omnis odit atque blanditiis exercitationem! Voluptatum.", | ||
positionInfo: "울릉도 동남쪽 뱃길따라 200리", | ||
alcoholName: "string", | ||
postAttachUrl: ["https://source.unsplash.com/random?wallpapers"], | ||
tagList: randomSelect(["tag1", "tag2"], []), | ||
quoteInfo: randomSelect( | ||
[ | ||
{ | ||
quoteNo: 1, | ||
quoteContent: "1", | ||
}, | ||
], | ||
[] | ||
), | ||
likeCount: randomNumber(), | ||
quoteCount: randomNumber(), | ||
followedByMe: randomSelect(true, false), | ||
}; | ||
}), | ||
}); | ||
}), | ||
getPostList,getPostDetail | ||
]; |
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,42 @@ | ||
import { PostInterface } from "@/types/post/PostInterface"; | ||
import { HttpResponse, http } from "msw"; | ||
import { randomBoolean, randomNumber, randomSelect } from "../utils/random"; | ||
/** | ||
* 포스트 상세보기 정보를 받아오는 핸들러 | ||
*/ | ||
export default http.get(`${process.env.NEXT_PUBLIC_BASE_URL}/posts/1`, () => { | ||
return HttpResponse.json<PostInterface>({ | ||
nickname: "testNick", | ||
id: "userID", | ||
updateDt: "2023-11-08T13:05:09.531Z", | ||
createdAt: "2023-11-08T13:05:09.531Z", | ||
edited: randomBoolean(), | ||
postNo: 135, | ||
postContent: | ||
"Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eos ullam aut minus aliquam quis officia, non dolore omnis, magnam totam tenetur ad harum? Mollitia omnis odit atque blanditiis exercitationem! Voluptatum.", | ||
positionInfo: "울릉도 동남쪽 뱃길따라 200리", | ||
alcoholName: "string", | ||
postAttachUrl: randomSelect( | ||
["https://source.unsplash.com/random?wallpapers"], | ||
[] | ||
), | ||
tagList: randomSelect(["tag1", "tag2"], []), | ||
quoteInfo: randomSelect( | ||
[ | ||
{ | ||
quoteNo: 1, | ||
quoteContent: "1", | ||
}, | ||
], | ||
[] | ||
), | ||
likeCount: randomNumber(), | ||
quoteCount: randomNumber(), | ||
followedByMe: randomBoolean(), | ||
likedByme: randomBoolean(), | ||
profileImgUrls: randomSelect( | ||
"https://source.unsplash.com/random?wallpapers", | ||
"" | ||
), | ||
}); | ||
}); |
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,47 @@ | ||
import { PostInterface } from "@/types/post/PostInterface"; | ||
import { HttpResponse, http } from "msw"; | ||
import { randomBoolean, randomNumber, randomSelect } from "../utils/random"; | ||
/** | ||
* 포스트 리스트를 받아오는 핸들러 | ||
*/ | ||
export default http.get(`${process.env.NEXT_PUBLIC_BASE_URL}/posts`, () => { | ||
return HttpResponse.json({ | ||
content: Array.from(new Array(5)).map((_data, i): PostInterface => { | ||
return { | ||
nickname: "testNick", | ||
id: "userID", | ||
updateDt: "2023-11-08T13:05:09.531Z", | ||
createdAt: "2023-11-08T13:05:09.531Z", | ||
edited: randomBoolean(), | ||
postNo: i, | ||
postContent: | ||
"Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eos ullam aut minus aliquam quis officia, non dolore omnis, magnam totam tenetur ad harum? Mollitia omnis odit atque blanditiis exercitationem! Voluptatum.", | ||
positionInfo: "울릉도 동남쪽 뱃길따라 200리", | ||
alcoholName: "string", | ||
postAttachUrl: randomSelect( | ||
["https://source.unsplash.com/random?wallpapers"], | ||
[] | ||
), | ||
tagList: randomSelect(["tag1", "tag2"], []), | ||
quoteInfo: randomSelect( | ||
[ | ||
{ | ||
quoteNo: 1, | ||
quoteContent: "1", | ||
}, | ||
], | ||
[] | ||
), | ||
likeCount: randomNumber(), | ||
quoteCount: randomNumber(), | ||
followedByMe: randomBoolean(), | ||
likedByme: randomBoolean(), | ||
profileImgUrls: randomSelect( | ||
"https://source.unsplash.com/random?wallpapers", | ||
"" | ||
), | ||
}; | ||
}), | ||
}); | ||
}); | ||
|
Oops, something went wrong.