-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
170 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { SanityImage } from "src/components/image/SanityImage"; | ||
import SmileyBox from "src/components/smileyBox/SmileyBox"; | ||
import Text from "src/components/text/Text"; | ||
import { OpennessSection } from "studio/lib/interfaces/pages"; | ||
|
||
import styles from "./openness.module.css"; | ||
|
||
export interface OpennessProps { | ||
section: OpennessSection; | ||
} | ||
|
||
export default function Openness({ section }: OpennessProps) { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<div className={styles.title}> | ||
<Text type={"h2"}>{section.basicTitle}</Text> | ||
</div> | ||
<div className={styles.content}> | ||
<div className={styles.image}> | ||
<SanityImage image={section.image} /> | ||
</div> | ||
<SmileyBox description={section.description} /> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
max-width: var(--max-content-width-large); | ||
padding: 0 2rem; | ||
margin: 5rem auto; | ||
gap: 2rem; | ||
color: var(--text-primary); | ||
} | ||
|
||
.image { | ||
height: 30rem; | ||
|
||
& img { | ||
border-radius: 0.375rem 6rem 0.375rem 0.375rem; | ||
} | ||
} | ||
|
||
.title { | ||
width: 40rem; | ||
color: var(--text-primary); | ||
} | ||
|
||
.content { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-start; | ||
padding: 0.25rem; | ||
gap: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Text from "src/components/text/Text"; | ||
|
||
import styles from "./smileyBox.module.css"; | ||
|
||
type SmileyBoxProps = { | ||
background?: "dark" | "light"; | ||
description: string; | ||
}; | ||
|
||
export default function SmileyBox({ description }: SmileyBoxProps) { | ||
return ( | ||
description && ( | ||
<div className={styles.wrapper}> | ||
<div className={styles.smiley} /> | ||
<Text type={"h3"}>{description}</Text> | ||
</div> | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
height: 30rem; | ||
min-width: var(19.75rem); | ||
padding: 2.25rem; | ||
border-radius: 6rem 6rem 0.375rem 0.375rem; | ||
background-color: #dafbdc; | ||
} | ||
|
||
.smiley { | ||
&::before { | ||
content: ""; | ||
display: block; | ||
width: 4.86119rem; | ||
height: 4.86119rem; | ||
-webkit-mask: url("/_assets/happy-smiley-face.svg") no-repeat center; | ||
-webkit-mask-size: cover; | ||
mask: url("/_assets/happy-smiley-face.svg") no-repeat center; | ||
mask-size: cover; | ||
background-color: var(--text-primary); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { defineField } from "sanity"; | ||
|
||
import { titleID } from "studio/schemas/fields/text"; | ||
export const opennessID = "opennessSection"; | ||
|
||
export const opennessSection = defineField({ | ||
name: opennessID, | ||
title: "Openness", | ||
type: "object", | ||
fields: [ | ||
{ | ||
name: titleID.basic, | ||
title: "Title", | ||
description: | ||
"Enter the primary title that will be displayed at the top of the section.", | ||
type: "internationalizedArrayString", | ||
}, | ||
{ | ||
name: "image", | ||
type: "image", | ||
title: "Image", | ||
description: "An image of the openness", | ||
options: { | ||
hotspot: true, | ||
}, | ||
}, | ||
{ | ||
name: "description", | ||
title: "Description", | ||
description: | ||
"Enter the description that will be displayed in the smiley block.", | ||
type: "internationalizedArrayString", | ||
}, | ||
], | ||
preview: { | ||
prepare() { | ||
return { | ||
title: "Openness Section", | ||
}; | ||
}, | ||
}, | ||
}); |