diff --git a/src/app/(main)/[slug]/page.tsx b/src/app/(main)/[slug]/page.tsx index 724c6cdfe..3a81faa26 100644 --- a/src/app/(main)/[slug]/page.tsx +++ b/src/app/(main)/[slug]/page.tsx @@ -72,13 +72,17 @@ async function Page({ params }: Props) { { slug }, { perspective }, ), - loadStudioQuery(COMPANY_LOCATIONS_QUERY, {}, { perspective }), + loadStudioQuery( + COMPANY_LOCATIONS_QUERY, + {}, + { perspective }, + ), loadStudioQuery( CUSTOMER_CASES_PAGE_QUERY, { slug }, { perspective }, ), - loadSharedQuery(CUSTOMER_CASES_QUERY, {}, { perspective }), + loadSharedQuery(CUSTOMER_CASES_QUERY, {}, { perspective }), ]); if (initialPage.data) { diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx index e090b95ed..89757bae1 100644 --- a/src/app/(main)/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -36,8 +36,16 @@ export default async function Layout({ ] = await Promise.all([ loadStudioQuery(NAV_QUERY, {}, { perspective }), loadStudioQuery(COMPANY_INFO_QUERY, {}, { perspective }), - loadStudioQuery(SOMEPROFILES_QUERY, {}, { perspective }), - loadStudioQuery(LEGAL_DOCUMENTS_QUERY, {}, { perspective }), + loadStudioQuery( + SOMEPROFILES_QUERY, + {}, + { perspective }, + ), + loadStudioQuery( + LEGAL_DOCUMENTS_QUERY, + {}, + { perspective }, + ), loadStudioQuery(BRAND_ASSETS_QUERY, {}, { perspective }), ]); diff --git a/src/customerCases/CustomerCases.tsx b/src/customerCases/CustomerCases.tsx index 54c7a2c15..89a80bdea 100644 --- a/src/customerCases/CustomerCases.tsx +++ b/src/customerCases/CustomerCases.tsx @@ -1,12 +1,12 @@ import Text from "src/components/text/Text"; import { CustomerCasePage } from "studio/lib/interfaces/specialPages"; import { CustomerCase } from "studioShared/lib/interfaces/customerCases"; - +import { RichText } from "src/components/richText/RichText"; import styles from "./customerCases.module.css"; interface CustomerCasesProps { customerCases: CustomerCasePage; - sharedCustomerCases: CustomerCase; + sharedCustomerCases: CustomerCase[]; } const CustomerCases = async ({ @@ -16,6 +16,14 @@ const CustomerCases = async ({ return (
{customerCases.basicTitle} + {sharedCustomerCases.map((customerCase: CustomerCase) => ( +
+ + {customerCase.basicTitle} + + {customerCase.richText && } +
+ ))}
); }; diff --git a/src/customerCases/CustomerCasesPreview.tsx b/src/customerCases/CustomerCasesPreview.tsx index 1e3c3d940..0b285600c 100644 --- a/src/customerCases/CustomerCasesPreview.tsx +++ b/src/customerCases/CustomerCasesPreview.tsx @@ -10,7 +10,7 @@ import CustomerCases from "./CustomerCases"; interface CustomerCasesPreviewProps { initialCustomerCases: QueryResponseInitial; - initialSharedCustomerCases: QueryResponseInitial; + initialSharedCustomerCases: QueryResponseInitial; } const CustomerCasesPreview = ({ @@ -23,7 +23,7 @@ const CustomerCasesPreview = ({ { initial: initialCustomerCases }, ); - const { data: sharedCustomerCases } = useQuery( + const { data: sharedCustomerCases } = useQuery( CUSTOMER_CASES_QUERY, {}, { initial: initialSharedCustomerCases }, diff --git a/src/customerCases/customerCases.module.css b/src/customerCases/customerCases.module.css index 858b2aa9d..b1b8fdd4d 100644 --- a/src/customerCases/customerCases.module.css +++ b/src/customerCases/customerCases.module.css @@ -1,7 +1,6 @@ .wrapper { - display: flex; - flex-direction: column; - padding: 10rem 5rem; - gap: 5rem; - } - \ No newline at end of file + display: flex; + flex-direction: column; + padding: 10rem 5rem; + gap: 5rem; +} diff --git a/studio/lib/store.ts b/studio/lib/store.ts index f4faf02e8..22f465461 100644 --- a/studio/lib/store.ts +++ b/studio/lib/store.ts @@ -1,13 +1,13 @@ -import {createQueryStore} from "@sanity/react-loader"; +import { createQueryStore } from "@sanity/react-loader"; import { client } from "./client"; import { token } from "./token"; -const { - loadQuery: loadStudioQuery, - setServerClient, - } = createQueryStore({client: false, ssr: true}) +const { loadQuery: loadStudioQuery, setServerClient } = createQueryStore({ + client: false, + ssr: true, +}); - setServerClient(client.withConfig({ token })); +setServerClient(client.withConfig({ token })); -export { loadStudioQuery } +export { loadStudioQuery }; diff --git a/studioShared/lib/interfaces/customerCases.ts b/studioShared/lib/interfaces/customerCases.ts index 7c5be5763..3243df58b 100644 --- a/studioShared/lib/interfaces/customerCases.ts +++ b/studioShared/lib/interfaces/customerCases.ts @@ -1,3 +1,4 @@ +import { PortableTextBlock } from "src/components/richText/RichText"; import { Slug } from "./global"; export interface CustomerCase { @@ -9,4 +10,5 @@ export interface CustomerCase { _createdAt: string; _rev: string; _type: string; + richText: PortableTextBlock[]; } diff --git a/studioShared/lib/store.ts b/studioShared/lib/store.ts index 4cc1bc360..d092e427d 100644 --- a/studioShared/lib/store.ts +++ b/studioShared/lib/store.ts @@ -1,13 +1,13 @@ -import {createQueryStore} from "@sanity/react-loader"; +import { createQueryStore } from "@sanity/react-loader"; import { sharedClient } from "./client"; import { token } from "./token"; -const { - loadQuery: loadSharedQuery, - setServerClient, - } = createQueryStore({client: false, ssr: true}) +const { loadQuery: loadSharedQuery, setServerClient } = createQueryStore({ + client: false, + ssr: true, +}); setServerClient(sharedClient.withConfig({ token })); -export { loadSharedQuery }; +export { loadSharedQuery };