From b7aeb7f90c8b53e4da02ca3f6ea1acedb697800d Mon Sep 17 00:00:00 2001 From: Petter Hohle Date: Thu, 12 Dec 2024 13:08:44 +0100 Subject: [PATCH] =?UTF-8?q?Add=20l=C3=A6reglede=20content=20to=20Sanity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sections/learning/Learning.tsx | 15 ++++++------ .../sections/learning/learning.module.css | 14 +---------- src/components/sections/openness/Openness.tsx | 7 +++++- studio/lib/interfaces/pages.ts | 4 ++++ studio/lib/queries/pages.ts | 4 ++++ studio/schemas/objects/sections/learning.ts | 24 +++++++++++++++++++ 6 files changed, 46 insertions(+), 22 deletions(-) diff --git a/src/components/sections/learning/Learning.tsx b/src/components/sections/learning/Learning.tsx index c85533445..b3119f655 100644 --- a/src/components/sections/learning/Learning.tsx +++ b/src/components/sections/learning/Learning.tsx @@ -29,17 +29,16 @@ export default function Learning({ section }: LearningProps) {
- - Artikkel · 5 min{" "} + + {section.articleTag} - - - Tidenes beste konferansesesong for Variant + + + {section.articleTitle} - - I Variant har vi en veldig uttalt strategi rundt - kompetansebygging. Vi kaller den læreglede. + + {section.articleSubtitle}
diff --git a/src/components/sections/learning/learning.module.css b/src/components/sections/learning/learning.module.css index de8ee494b..b0b62c38b 100644 --- a/src/components/sections/learning/learning.module.css +++ b/src/components/sections/learning/learning.module.css @@ -79,18 +79,6 @@ align-self: stretch; } -.textContainer { - color: var(--text-primary-light); -} - -.articleTag { - color: var(--text-primary-light); -} - -.articleTitle { - color: var(--text-primary-light); -} - -.articleSubtitle { +.text { color: var(--text-primary-light); } diff --git a/src/components/sections/openness/Openness.tsx b/src/components/sections/openness/Openness.tsx index 54cec6ad8..b776976fe 100644 --- a/src/components/sections/openness/Openness.tsx +++ b/src/components/sections/openness/Openness.tsx @@ -19,7 +19,12 @@ export default function Openness({ section }: OpennessProps) {
- + ); diff --git a/studio/lib/interfaces/pages.ts b/studio/lib/interfaces/pages.ts index 13b4f7527..a46cdcca0 100644 --- a/studio/lib/interfaces/pages.ts +++ b/studio/lib/interfaces/pages.ts @@ -184,6 +184,10 @@ export interface LearningSection { basicTitle: string; image: IImage; description: string; + articleLink: string; + articleTag: string; + articleTitle: string; + articleSubtitle: string; } export type Section = diff --git a/studio/lib/queries/pages.ts b/studio/lib/queries/pages.ts index fae13c682..efe5722fd 100644 --- a/studio/lib/queries/pages.ts +++ b/studio/lib/queries/pages.ts @@ -122,6 +122,10 @@ const SECTIONS_FRAGMENT = groq` _type == "learningSection" => { "basicTitle": ${translatedFieldFragment("basicTitle")}, "description": ${translatedFieldFragment("description")}, + "articleLink": ${translatedFieldFragment("articleLink")}, + "articleTag": ${translatedFieldFragment("articleTag")}, + "articleTitle": ${translatedFieldFragment("articleTitle")}, + "articleSubtitle": ${translatedFieldFragment("articleSubtitle")}, } } `; diff --git a/studio/schemas/objects/sections/learning.ts b/studio/schemas/objects/sections/learning.ts index 2248238ad..845cb639b 100644 --- a/studio/schemas/objects/sections/learning.ts +++ b/studio/schemas/objects/sections/learning.ts @@ -34,6 +34,30 @@ export const learningSection = defineField({ type: "internationalizedArrayString", validation: (rule) => rule.required(), }, + { + name: "articleLink", + title: "Article link", + type: "internationalizedArrayString", + validation: (rule) => rule.required(), + }, + { + name: "articleTag", + title: "Article tag", + type: "internationalizedArrayString", + validation: (rule) => rule.required(), + }, + { + name: "articleTitle", + title: "Article title", + type: "internationalizedArrayString", + validation: (rule) => rule.required(), + }, + { + name: "articleSubtitle", + title: "Article subtitle", + type: "internationalizedArrayString", + validation: (rule) => rule.required(), + }, ], preview: { prepare() {