From ce0da51041d3402e878d28c0b27593db7089126c Mon Sep 17 00:00:00 2001 From: jnsdls Date: Thu, 12 Dec 2024 03:18:24 +0000 Subject: [PATCH] fix category page crash (#5707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes: DASH-607 --- ## PR-Codex overview This PR focuses on modifying the `explore` functionality by removing the export of `ALL_CATEGORIES` from `data/explore` and adjusting the import statements in `page.tsx`. ### Detailed summary - Removed the export of `ALL_CATEGORIES` from `apps/dashboard/src/data/explore.ts`. - Updated `apps/dashboard/src/app/(dashboard)/explore/[category]/page.tsx` to only import `getCategory` from `data/explore`, excluding `ALL_CATEGORIES`. - Deleted the `generateStaticParams` function that utilized `ALL_CATEGORIES`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../src/app/(dashboard)/explore/[category]/page.tsx | 8 +------- apps/dashboard/src/data/explore.ts | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/explore/[category]/page.tsx b/apps/dashboard/src/app/(dashboard)/explore/[category]/page.tsx index f5fa3dc9673..97a27b5d640 100644 --- a/apps/dashboard/src/app/(dashboard)/explore/[category]/page.tsx +++ b/apps/dashboard/src/app/(dashboard)/explore/[category]/page.tsx @@ -11,7 +11,7 @@ import { ContractCardSkeleton, } from "components/explore/contract-card"; import { DeployUpsellCard } from "components/explore/upsells/deploy-your-own"; -import { ALL_CATEGORIES, getCategory } from "data/explore"; +import { getCategory } from "data/explore"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; @@ -131,9 +131,3 @@ export default async function ExploreCategoryPage( ); } - -export async function generateStaticParams() { - return ALL_CATEGORIES.map((category) => ({ - params: { category }, - })); -} diff --git a/apps/dashboard/src/data/explore.ts b/apps/dashboard/src/data/explore.ts index b0261b4034d..731bd453120 100644 --- a/apps/dashboard/src/data/explore.ts +++ b/apps/dashboard/src/data/explore.ts @@ -309,5 +309,3 @@ function isExploreCategory(category: string): category is ExploreCategoryName { export const EXPLORE_PAGE_DATA = Object.values(CATEGORIES).filter((v) => "showInExplore" in v ? v.showInExplore !== false : true, ); - -export const ALL_CATEGORIES = Object.values(CATEGORIES).map((v) => v.id);