From d00eff7694f18869ff23ab2fb5ce5f08c13bf9c4 Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Sun, 13 Aug 2023 14:40:19 +0200 Subject: [PATCH] Tried some updates --- app/[locale]/{[[...slug]] => [...slug]}/page.tsx | 0 .../pages/category-page.tsx | 0 .../{[[...slug]] => [...slug]}/pages/home-page.tsx | 0 .../pages/product-page.tsx | 0 .../{[[...slug]] => [...slug]}/pages/single-page.tsx | 0 app/[locale]/{...page.tsx => page.tsx} | 0 helpers/get-query-from-slug.ts | 12 ------------ 7 files changed, 12 deletions(-) rename app/[locale]/{[[...slug]] => [...slug]}/page.tsx (100%) rename app/[locale]/{[[...slug]] => [...slug]}/pages/category-page.tsx (100%) rename app/[locale]/{[[...slug]] => [...slug]}/pages/home-page.tsx (100%) rename app/[locale]/{[[...slug]] => [...slug]}/pages/product-page.tsx (100%) rename app/[locale]/{[[...slug]] => [...slug]}/pages/single-page.tsx (100%) rename app/[locale]/{...page.tsx => page.tsx} (100%) diff --git a/app/[locale]/[[...slug]]/page.tsx b/app/[locale]/[...slug]/page.tsx similarity index 100% rename from app/[locale]/[[...slug]]/page.tsx rename to app/[locale]/[...slug]/page.tsx diff --git a/app/[locale]/[[...slug]]/pages/category-page.tsx b/app/[locale]/[...slug]/pages/category-page.tsx similarity index 100% rename from app/[locale]/[[...slug]]/pages/category-page.tsx rename to app/[locale]/[...slug]/pages/category-page.tsx diff --git a/app/[locale]/[[...slug]]/pages/home-page.tsx b/app/[locale]/[...slug]/pages/home-page.tsx similarity index 100% rename from app/[locale]/[[...slug]]/pages/home-page.tsx rename to app/[locale]/[...slug]/pages/home-page.tsx diff --git a/app/[locale]/[[...slug]]/pages/product-page.tsx b/app/[locale]/[...slug]/pages/product-page.tsx similarity index 100% rename from app/[locale]/[[...slug]]/pages/product-page.tsx rename to app/[locale]/[...slug]/pages/product-page.tsx diff --git a/app/[locale]/[[...slug]]/pages/single-page.tsx b/app/[locale]/[...slug]/pages/single-page.tsx similarity index 100% rename from app/[locale]/[[...slug]]/pages/single-page.tsx rename to app/[locale]/[...slug]/pages/single-page.tsx diff --git a/app/[locale]/...page.tsx b/app/[locale]/page.tsx similarity index 100% rename from app/[locale]/...page.tsx rename to app/[locale]/page.tsx diff --git a/helpers/get-query-from-slug.ts b/helpers/get-query-from-slug.ts index 2979b0101..83657ca3f 100644 --- a/helpers/get-query-from-slug.ts +++ b/helpers/get-query-from-slug.ts @@ -1,6 +1,5 @@ import { categoryQuery, - homePageQuery, pageQuery, productQuery } from '@/lib/sanity/queries'; @@ -8,22 +7,11 @@ import { groq } from 'next-sanity'; const getQueryFromSlug = (slugArray: string[], locale: string) => { const docQuery: { [index: string]: string } = { - 'home': groq`${homePageQuery}`, 'product': groq`${productQuery}`, 'category': groq`${categoryQuery}`, 'page': groq`${pageQuery}`, } - if (!slugArray) { - return { - docType: "home", - queryParams: { - locale: locale - }, - query: docQuery.home, - } - } - let docType = '' const [slugStart] = slugArray