Skip to content

Commit

Permalink
Add læreglede content to Sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
petterhh committed Dec 12, 2024
1 parent 794d4e7 commit b7aeb7f
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 22 deletions.
15 changes: 7 additions & 8 deletions src/components/sections/learning/Learning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ export default function Learning({ section }: LearningProps) {
</div>
<div className={styles.textContainer}>
<div className={styles.textContent}>
<Text type="labelLarge" className={styles.articleTag}>
Artikkel · 5 min{" "}
<Text type="labelLarge" className={styles.text}>
{section.articleTag}
</Text>
<Link href="https://blog.variant.no/tidenes-beste-konferansesesong-for-variant-700baa5e82a3">
<Text type="h3" className={styles.articleTitle}>
Tidenes beste konferansesesong for Variant
<Link href={section.articleLink}>
<Text type="h3" className={styles.text}>
{section.articleTitle}
</Text>
</Link>
<Text type="bodyBig" className={styles.articleSubtitle}>
I Variant har vi en veldig uttalt strategi rundt
kompetansebygging. Vi kaller den læreglede.
<Text type="bodyBig" className={styles.text}>
{section.articleSubtitle}
</Text>
</div>
</div>
Expand Down
14 changes: 1 addition & 13 deletions src/components/sections/learning/learning.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
7 changes: 6 additions & 1 deletion src/components/sections/openness/Openness.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ export default function Openness({ section }: OpennessProps) {
<div className={styles.image}>
<SanityImage image={section.image} />
</div>
<SmileyBox description={section.description} />
<SmileyBox
description={section.description}
smileySide="left"
smileyType="happy"
backgroundColor="green"
/>
</div>
</div>
);
Expand Down
4 changes: 4 additions & 0 deletions studio/lib/interfaces/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ export interface LearningSection {
basicTitle: string;
image: IImage;
description: string;
articleLink: string;
articleTag: string;
articleTitle: string;
articleSubtitle: string;
}

export type Section =
Expand Down
4 changes: 4 additions & 0 deletions studio/lib/queries/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")},
}
}
`;
Expand Down
24 changes: 24 additions & 0 deletions studio/schemas/objects/sections/learning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b7aeb7f

Please sign in to comment.