Skip to content

Commit

Permalink
Make entire block clickable
Browse files Browse the repository at this point in the history
Add border radius and hover state
  • Loading branch information
petterhh committed Dec 12, 2024
1 parent b7aeb7f commit eb96603
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/components/sections/learning/Learning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ export default function Learning({ section }: LearningProps) {
<div className={styles.image}>
<SanityImage image={section.image} />
</div>
<div className={styles.textContainer}>
<div className={styles.textContent}>
<Text type="labelLarge" className={styles.text}>
{section.articleTag}
</Text>
<Link href={section.articleLink}>
<Link href={section.articleLink}>
<div className={styles.textContainer}>
<div className={styles.textContent}>
<Text type="labelLarge" className={styles.text}>
{section.articleTag}
</Text>
<Text type="h3" className={styles.text}>
{section.articleTitle}
</Text>
</Link>
<Text type="bodyBig" className={styles.text}>
{section.articleSubtitle}
</Text>
<Text type="bodyBig" className={styles.text}>
{section.articleSubtitle}
</Text>
</div>
</div>
</div>
</Link>
</div>
</div>
);
Expand Down
6 changes: 6 additions & 0 deletions src/components/sections/learning/learning.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
gap: 0.75rem;
background-color: var(--surface-blue);
color: var(--text-primary-light);
border-radius: 6px;

&:hover {
background-color: var(--Blue-700);
border-radius: 24px;
}
}

.textContent {
Expand Down
2 changes: 1 addition & 1 deletion studio/lib/queries/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ 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
3 changes: 2 additions & 1 deletion studio/schemas/objects/sections/learning.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineField } from "sanity";

import { titleID } from "studio/schemas/fields/text";

export const learningID = "learningSection";

export const learningSection = defineField({
Expand Down Expand Up @@ -37,7 +38,7 @@ export const learningSection = defineField({
{
name: "articleLink",
title: "Article link",
type: "internationalizedArrayString",
type: "string",
validation: (rule) => rule.required(),
},
{
Expand Down

0 comments on commit eb96603

Please sign in to comment.