From 57a2495e36daca44d1ea6568776bfa03508c224b Mon Sep 17 00:00:00 2001 From: Ane Date: Fri, 27 Sep 2024 10:35:20 +0200 Subject: [PATCH] rename oage.ts to pages.ts --- src/app/(main)/[slug]/[id]/page.tsx | 2 +- src/app/(main)/[slug]/page.tsx | 2 +- src/app/(main)/page.tsx | 2 +- src/app/sitemap.ts | 2 +- src/blog/BlogPreview.tsx | 2 +- src/components/sections/article/ArticlePreview.tsx | 2 +- .../sections/callToAction/CallToActionPreview.tsx | 2 +- src/components/sections/callout/CalloutPreview.tsx | 2 +- src/components/sections/grid/GridPreview.tsx | 2 +- src/components/sections/hero/HeroPreview.tsx | 2 +- .../imageSection/ImageSectionComponentPreview.tsx | 2 +- src/components/sections/logoSalad/LogoSaladPreview.tsx | 2 +- .../sections/testimonials/TestimonialsPreview.tsx | 2 +- src/post/PostPagePreview.tsx | 2 +- src/utils/api.ts | 2 +- studio/lib/queries/{page.ts => pages.ts} | 0 studio/lib/queries/{document.ts => siteMap.ts} | 1 + studio/lib/queries/specialPages.ts | 8 +++++--- 18 files changed, 21 insertions(+), 18 deletions(-) rename studio/lib/queries/{page.ts => pages.ts} (100%) rename studio/lib/queries/{document.ts => siteMap.ts} (90%) diff --git a/src/app/(main)/[slug]/[id]/page.tsx b/src/app/(main)/[slug]/[id]/page.tsx index 1dff97b8e..4d8434130 100644 --- a/src/app/(main)/[slug]/[id]/page.tsx +++ b/src/app/(main)/[slug]/[id]/page.tsx @@ -11,7 +11,7 @@ import { MORE_POST_PREVIEW, POST_SLUG_QUERY, SEO_POST_SLUG_QUERY, -} from "studio/lib/queries/page"; +} from "studio/lib/queries/pages"; type Props = { params: { diff --git a/src/app/(main)/[slug]/page.tsx b/src/app/(main)/[slug]/page.tsx index 9f058a5c1..53dd40773 100644 --- a/src/app/(main)/[slug]/page.tsx +++ b/src/app/(main)/[slug]/page.tsx @@ -21,7 +21,7 @@ import { POSTS_QUERY, SEO_SLUG_QUERY, SLUG_QUERY, -} from "studio/lib/queries/page"; +} from "studio/lib/queries/pages"; import { COMPENSATIONS_PAGE_QUERY, CUSTOMER_CASES_PAGE_QUERY, diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx index 4ad33d8dc..712575155 100644 --- a/src/app/(main)/page.tsx +++ b/src/app/(main)/page.tsx @@ -6,7 +6,7 @@ import SectionRenderer from "src/utils/renderSection"; import { fetchSeoData, generateMetadataFromSeo } from "src/utils/seo"; import { LinkType } from "studio/lib/interfaces/navigation"; import { PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY, SEO_PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY, SEO_PAGE_QUERY } from "studio/lib/queries/pages"; import { LANDING_PAGE_REF_QUERY } from "studio/lib/queries/siteSettings"; import { loadStudioQuery } from "studio/lib/store"; diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 95f4ecc99..967463b04 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -3,7 +3,7 @@ import type { MetadataRoute } from "next"; import { client } from "studio/lib/client"; import { DocumentWithSlug } from "studio/lib/interfaces/global"; import { PageBuilder } from "studio/lib/interfaces/pages"; -import { DOCUMENTS_WITH_SLUG_QUERY } from "studio/lib/queries/document"; +import { DOCUMENTS_WITH_SLUG_QUERY } from "studio/lib/queries/siteMap"; import { LANDING_PAGE_QUERY } from "studio/lib/queries/siteSettings"; import { token } from "studio/lib/token"; diff --git a/src/blog/BlogPreview.tsx b/src/blog/BlogPreview.tsx index 3c2249998..39db25e88 100644 --- a/src/blog/BlogPreview.tsx +++ b/src/blog/BlogPreview.tsx @@ -3,7 +3,7 @@ import { QueryResponseInitial, useQuery } from "@sanity/react-loader"; import { Suspense } from "react"; import { BlogPage, Post } from "studio/lib/interfaces/pages"; -import { BLOG_PAGE_QUERY } from "studio/lib/queries/page"; +import { BLOG_PAGE_QUERY } from "studio/lib/queries/pages"; import { Blog } from "./Blog"; diff --git a/src/components/sections/article/ArticlePreview.tsx b/src/components/sections/article/ArticlePreview.tsx index ef0c272e3..3a7dd12a1 100644 --- a/src/components/sections/article/ArticlePreview.tsx +++ b/src/components/sections/article/ArticlePreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { ArticleSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import Article from "./Article"; diff --git a/src/components/sections/callToAction/CallToActionPreview.tsx b/src/components/sections/callToAction/CallToActionPreview.tsx index ac7c86f5f..e46a9052b 100644 --- a/src/components/sections/callToAction/CallToActionPreview.tsx +++ b/src/components/sections/callToAction/CallToActionPreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { CallToActionSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import CallToAction from "./CallToAction"; diff --git a/src/components/sections/callout/CalloutPreview.tsx b/src/components/sections/callout/CalloutPreview.tsx index d31e0d165..621fb1cf4 100644 --- a/src/components/sections/callout/CalloutPreview.tsx +++ b/src/components/sections/callout/CalloutPreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { CalloutSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import Callout from "./Callout"; diff --git a/src/components/sections/grid/GridPreview.tsx b/src/components/sections/grid/GridPreview.tsx index d5d3c0853..4842eeb8b 100644 --- a/src/components/sections/grid/GridPreview.tsx +++ b/src/components/sections/grid/GridPreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { GridSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import Grid from "./Grid"; diff --git a/src/components/sections/hero/HeroPreview.tsx b/src/components/sections/hero/HeroPreview.tsx index 6d2ac0a59..6cb8b30ea 100644 --- a/src/components/sections/hero/HeroPreview.tsx +++ b/src/components/sections/hero/HeroPreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { HeroSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import { Hero } from "./Hero"; diff --git a/src/components/sections/imageSection/ImageSectionComponentPreview.tsx b/src/components/sections/imageSection/ImageSectionComponentPreview.tsx index d12b4cb58..2400cda35 100644 --- a/src/components/sections/imageSection/ImageSectionComponentPreview.tsx +++ b/src/components/sections/imageSection/ImageSectionComponentPreview.tsx @@ -4,7 +4,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { ImageSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import ImageSectionComponent from "./ImageSectionComponent"; diff --git a/src/components/sections/logoSalad/LogoSaladPreview.tsx b/src/components/sections/logoSalad/LogoSaladPreview.tsx index 93587cc88..4ca84ea0e 100644 --- a/src/components/sections/logoSalad/LogoSaladPreview.tsx +++ b/src/components/sections/logoSalad/LogoSaladPreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { LogoSaladSection, PageBuilder } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import { LogoSalad } from "./LogoSalad"; diff --git a/src/components/sections/testimonials/TestimonialsPreview.tsx b/src/components/sections/testimonials/TestimonialsPreview.tsx index 17f65f224..c38c0c107 100644 --- a/src/components/sections/testimonials/TestimonialsPreview.tsx +++ b/src/components/sections/testimonials/TestimonialsPreview.tsx @@ -5,7 +5,7 @@ import { Suspense } from "react"; import { PreviewProps } from "src/types/preview"; import { PageBuilder, TestimonialsSection } from "studio/lib/interfaces/pages"; -import { PAGE_QUERY } from "studio/lib/queries/page"; +import { PAGE_QUERY } from "studio/lib/queries/pages"; import { Testimonials } from "./Testimonials"; diff --git a/src/post/PostPagePreview.tsx b/src/post/PostPagePreview.tsx index fc8bbe230..14ee10420 100644 --- a/src/post/PostPagePreview.tsx +++ b/src/post/PostPagePreview.tsx @@ -3,7 +3,7 @@ import { QueryResponseInitial, useQuery } from "@sanity/react-loader"; import { Suspense } from "react"; import { BlogPage, Post } from "studio/lib/interfaces/pages"; -import { POST_SLUG_QUERY } from "studio/lib/queries/page"; +import { POST_SLUG_QUERY } from "studio/lib/queries/pages"; import PostPage from "./PostPage"; diff --git a/src/utils/api.ts b/src/utils/api.ts index 52a6eccf9..d652d7d45 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -3,7 +3,7 @@ import { Post } from "studio/lib/interfaces/pages"; import { CATEGORIZED_POSTS_QUERY, COUNT_POSTS_QUERY, -} from "studio/lib/queries/page"; +} from "studio/lib/queries/pages"; interface FetchResult { data: Post[]; diff --git a/studio/lib/queries/page.ts b/studio/lib/queries/pages.ts similarity index 100% rename from studio/lib/queries/page.ts rename to studio/lib/queries/pages.ts diff --git a/studio/lib/queries/document.ts b/studio/lib/queries/siteMap.ts similarity index 90% rename from studio/lib/queries/document.ts rename to studio/lib/queries/siteMap.ts index 4e3f88efd..cfcbe1c72 100644 --- a/studio/lib/queries/document.ts +++ b/studio/lib/queries/siteMap.ts @@ -1,5 +1,6 @@ import { groq } from "next-sanity"; +//Site Map export const DOCUMENTS_WITH_SLUG_QUERY = groq` *[defined(slug)] `; diff --git a/studio/lib/queries/specialPages.ts b/studio/lib/queries/specialPages.ts index 4923380c7..a898c4f97 100644 --- a/studio/lib/queries/specialPages.ts +++ b/studio/lib/queries/specialPages.ts @@ -1,8 +1,10 @@ import { groq } from "next-sanity"; -export const CUSTOMER_CASES_PAGE_QUERY = groq` - *[_type == "customerCasesPage" && slug.current == $slug][0]`; - +//Compensations export const COMPENSATIONS_PAGE_QUERY = groq` *[_type == "compensations" && slug.current == $slug][0] `; + +//Customer Cases +export const CUSTOMER_CASES_PAGE_QUERY = groq` + *[_type == "customerCasesPage" && slug.current == $slug][0]`;