Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Fix build fail (#4488)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrik-Klijnsma-Work authored Nov 10, 2022
1 parent b2b9605 commit 0a02f1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Home = (props: StaticProps<typeof getStaticProps>) => {

const { topicalStructure } = content;

const { topicalConfig, measureTheme, thermometer } = topicalStructure;
const { topicalConfig, measureTheme, thermometer, kpiThemes } = topicalStructure;

const { textNl, textShared } = useDynamicLokalizeTexts<LokalizeTexts>(pageText, selectLokalizeTexts);

Expand Down Expand Up @@ -180,7 +180,7 @@ const Home = (props: StaticProps<typeof getStaticProps>) => {
)}

<Box spacing={{ _: 5, md: 6 }} paddingX={{ _: space[3], sm: space[4] }}>
{topicalStructure.topicalConfig.themes.map((theme) => {
{kpiThemes.themes.map((theme) => {
return (
<Box key={theme.title}>
<Box marginBottom={4}>
Expand Down
8 changes: 6 additions & 2 deletions packages/app/src/queries/get-topical-structure-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import { SeverityIndicatorTimelineEventConfig } from '~/components/severity-indi

export function getTopicalStructureQuery(locale: string) {
const query = `// groq
{
{
'topicalConfig': *[
_type == 'topicalPageConfig' && !(_id in path("drafts.**"))
][0]{
'title': title.${locale},
'description': description.${locale},
'description': description.${locale}
},
'kpiThemes': *[
_type == 'themeCollection' && !(_id in path("drafts.**"))
][0]{
'themes': themes[]->{
"title":title.${locale},
"subTitle":subTitle.${locale},
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/queries/query-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PortableTextEntry } from '@sanity/block-content-to-react';

export interface TopicalSanityData {
topicalConfig: TopicalConfig;
kpiThemes: KpiThemes;
measureTheme: MeasureTheme;
thermometer: ThermometerConfig;
}
Expand Down Expand Up @@ -48,9 +49,11 @@ interface ThermometerLevel {
interface TopicalConfig {
title: string;
description: PortableTextEntry[];
themes: TopicalTheme[];
}

interface KpiThemes {
themes: TopicalTheme[];
}
interface Theme {
title: string;
subTitle: PortableTextEntry[] | null;
Expand Down

0 comments on commit 0a02f1d

Please sign in to comment.