Skip to content

Commit

Permalink
DIGG-160-beta: Updating preamble on hero
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Munterud committed Jan 22, 2024
1 parent 501c76f commit b28575e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pages/goda-exempel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => {
seo: {
...populateSeo,
title: "Goda exempel - Sveriges Dataportal",
description: "Inspirerande exempel relaterat till Data & API:er.",
description: "Goda exempel på datadriven innovation i samhället.",
},
basePath: `/goda-exempel`,
heading: "Goda exempel",
preamble: "Goda exempel på datadriven innovation i samhället.",
heroImage: renderImage({
src: "/images/goodExamplesHero.png",
width: 1700,
Expand Down
1 change: 1 addition & 0 deletions pages/nyheter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => {
},
basePath: `/nyheter`,
heading: "Nyheter",
preamble: "Nyheter för Sveriges Dataportal",
heroImage: renderImage({
src: "/images/newsHero.png",
width: 1700,
Expand Down
8 changes: 7 additions & 1 deletion utilities/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ type ResolvedPage = {
export const resolvePage = (props: DataportalPageProps): ResolvedPage => {
switch (props.type) {
case "RootAggregate":
return { seo: props.seo, heroImage: props.image, heading: props.heading };
return {
seo: props.seo,
heroImage: props.image,
heading: props.heading,
preamble: props.preamble,
};
case "DomainAggregate":
return { seo: props.seo, heroImage: props.image, heading: props.heading };
case "MultiContainer":
Expand All @@ -60,6 +65,7 @@ export const resolvePage = (props: DataportalPageProps): ResolvedPage => {
seo: props.seo,
heading: props.heading,
heroImage: props.heroImage,
preamble: props.preamble,
};
case "Form":
return {};
Expand Down
5 changes: 4 additions & 1 deletion utilities/queryHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export interface PublicationListResponse {
seo?: SeoDataFragment;
basePath?: string;
heading?: string;
preamble?: string;
heroImage?: ImageFragment | null;
}

Expand Down Expand Up @@ -231,6 +232,7 @@ export interface PublicationListOptions {
seo?: SeoDataFragment;
basePath?: string;
heading?: string;
preamble?: string;
heroImage?: ImageFragment | null;
}

Expand Down Expand Up @@ -352,7 +354,7 @@ export const getPublicationsList = async (
) => {
// If nextjs should check for changes on the server
const revalidate = true;
const { seo, basePath, heading, heroImage } = opts || {};
const { seo, basePath, heading, preamble, heroImage } = opts || {};

try {
const { data, error } = await client.query<
Expand Down Expand Up @@ -394,6 +396,7 @@ export const getPublicationsList = async (
seo: seo || null,
basePath: basePath || null,
heading: heading || null,
preamble: preamble || null,
heroImage: heroImage || null,
} as PublicationListResponse,
...(revalidate
Expand Down

0 comments on commit b28575e

Please sign in to comment.