mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
Tried some updates
This commit is contained in:
parent
d00eff7694
commit
1ca052cc0b
@ -3,7 +3,6 @@ import { clientFetch } from 'lib/sanity/sanity.client';
|
|||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
import CategoryPage from './pages/category-page';
|
import CategoryPage from './pages/category-page';
|
||||||
import HomePage from './pages/home-page';
|
|
||||||
import ProductPage from './pages/product-page';
|
import ProductPage from './pages/product-page';
|
||||||
import SinglePage from './pages/single-page';
|
import SinglePage from './pages/single-page';
|
||||||
|
|
||||||
@ -49,7 +48,6 @@ export default async function Page({ params }: PageParams) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{docType === 'home' && <HomePage query={query} queryParams={queryParams} />}
|
|
||||||
{docType === 'page' && <SinglePage query={query} queryParams={queryParams} />}
|
{docType === 'page' && <SinglePage query={query} queryParams={queryParams} />}
|
||||||
{docType === 'product' && <ProductPage query={query} queryParams={queryParams} />}
|
{docType === 'product' && <ProductPage query={query} queryParams={queryParams} />}
|
||||||
{docType === 'category' && <CategoryPage query={query} queryParams={queryParams} />}
|
{docType === 'category' && <CategoryPage query={query} queryParams={queryParams} />}
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
import DynamicContentManager from '@/components/layout/dynamic-content-manager/dynamic-content-manager';
|
|
||||||
import { clientFetch } from '@/lib/sanity/sanity.client';
|
|
||||||
import { notFound } from 'next/navigation';
|
|
||||||
|
|
||||||
interface HomePageParams {
|
|
||||||
query: string;
|
|
||||||
queryParams: {
|
|
||||||
slug: string;
|
|
||||||
locale: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function HomePage({ query = '', queryParams }: HomePageParams) {
|
|
||||||
const homePage = await clientFetch(query, queryParams);
|
|
||||||
|
|
||||||
if (!homePage) return notFound();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<DynamicContentManager content={homePage?.content} />;
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user