-
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.
Merge pull request #85 from TripInfoWeb/dev_informations
Skeleton 컴포넌트 생성
- Loading branch information
Showing
31 changed files
with
452 additions
and
245 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import RecommendationList from "@/components/informations/RecommendationList"; | ||
import RecommendationListSkeleton from "@/components/skeleton/informations/RecommendationListSkeleton"; | ||
import { CATEGORY_TEXT } from "@/constants/informations/category"; | ||
import InformationViewerContainer from "@/containers/informations/InformationViewerContainer"; | ||
import { Suspense } from "react"; | ||
|
||
type MyProps = { | ||
params: { category: string; id: string }; | ||
}; | ||
|
||
export async function generateMetadata({ params: { category, id } }: MyProps) { | ||
const postId = Number(id); | ||
if (postId <= 0 || !Number.isSafeInteger(postId)) { | ||
throw Error("Not Found"); | ||
} | ||
|
||
return { | ||
title: `정보 - ${CATEGORY_TEXT[category]} - ${postId}`, | ||
description: "Solitour의 정보 상세 페이지", | ||
}; | ||
} | ||
|
||
export default function page({ params: { category, id } }: MyProps) { | ||
if ( | ||
category !== "restaurant" && | ||
category !== "accommodation" && | ||
category !== "activity" | ||
) { | ||
throw Error("Not Found"); | ||
} | ||
|
||
const postId = Number(id); | ||
if (postId < 1 || !Number.isSafeInteger(postId)) { | ||
throw Error("Not Found"); | ||
} | ||
|
||
return ( | ||
<div className="flex flex-col items-center"> | ||
<InformationViewerContainer category={category} id={postId} /> | ||
<Suspense fallback={<RecommendationListSkeleton />}> | ||
<RecommendationList /> | ||
</Suspense> | ||
</div> | ||
); | ||
} |
36 changes: 0 additions & 36 deletions
36
src/app/informations/(detail)/accommondation/[id]/page.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
import CategoryLinks from "@/components/informations/CategoryLinks"; | ||
import InformationListSkeleton from "@/components/skeleton/informations/InformationListSkeleton"; | ||
import { CATEGORY_TEXT } from "@/constants/informations/category"; | ||
import InformationListContainer from "@/containers/informations/InformationListContainer"; | ||
import { Suspense } from "react"; | ||
|
||
type MyProps = { | ||
params: { category: string }; | ||
searchParams: { [key: string]: string | undefined }; | ||
}; | ||
|
||
export async function generateMetadata({ params: { category } }: MyProps) { | ||
return { | ||
title: `정보 - ${CATEGORY_TEXT[category]}`, | ||
description: "Solitour의 정보 목록 페이지", | ||
}; | ||
} | ||
|
||
export default function page({ params, searchParams }: MyProps) { | ||
return ( | ||
<div className="flex flex-col items-center"> | ||
<CategoryLinks category={params.category} /> | ||
<Suspense | ||
fallback={ | ||
<InformationListSkeleton | ||
category={params.category} | ||
subCategory={searchParams["subCategory"]!} | ||
/> | ||
} | ||
> | ||
<InformationListContainer | ||
category={params.category} | ||
subCategory={searchParams["subCategory"]!} | ||
/> | ||
</Suspense> | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
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,16 +1,25 @@ | ||
import TabList from "@/components/home/TabList"; | ||
import BestInformationListSkeleton from "@/components/skeleton/home/BestInformationListSkeleton"; | ||
import NewMeetingListSkeleton from "@/components/skeleton/home/NewMeetingListSkeleton"; | ||
import BestInformationListContainer from "@/containers/home/BestInformationListContainer"; | ||
import HomeCarouselContainer from "@/containers/home/HomeCarouselContainer"; | ||
import NewMeetingListContainer from "@/containers/home/NewMeetingListContainer"; | ||
import { Suspense } from "react"; | ||
|
||
// todo | ||
export default function Home() { | ||
return ( | ||
<div className="flex flex-col items-center"> | ||
<HomeCarouselContainer /> | ||
<TabList /> | ||
<BestInformationListContainer /> | ||
<NewMeetingListContainer /> | ||
|
||
{/* TODO: async 사용 시 마우스 스크롤 문제 */} | ||
<Suspense fallback={<BestInformationListSkeleton />}> | ||
<BestInformationListContainer /> | ||
</Suspense> | ||
<Suspense fallback={<NewMeetingListSkeleton />}> | ||
<NewMeetingListContainer /> | ||
</Suspense> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.