-
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
13 changed files
with
280 additions
and
9 deletions.
There are no files selected for viewing
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
import { Handbook } from "src/components/sections/compensation-calculator/CompensationCalculator"; | ||
import SmileyBox from "src/components/smileyBox/SmileyBox"; | ||
import Text from "src/components/text/Text"; | ||
import { GenerositySection } from "studio/lib/interfaces/pages"; | ||
import { CompensationCalculatorBackground } from "studio/schemas/objects/sections/compensation-calculator"; | ||
|
||
import styles from "./generosity.module.css"; | ||
|
||
export interface GenerosityProps { | ||
section: GenerositySection; | ||
language: string; | ||
} | ||
|
||
export default function Generosity({ section, language }: GenerosityProps) { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<Text type={"h2"} className={styles.title}> | ||
{section.basicTitle} | ||
</Text> | ||
<div className={styles.content}> | ||
<SmileyBox | ||
description={section.description} | ||
smileySide="right" | ||
smileyType="smug" | ||
backgroundColor="purple" | ||
/> | ||
<Handbook | ||
title={section.handbookBlock.handbookTitle} | ||
description={section.handbookBlock.handbookDescription} | ||
link={section.handbookBlock.handbookLink} | ||
sectionBackground={CompensationCalculatorBackground.Violet} | ||
language={language} | ||
/> | ||
</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,53 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
max-width: var(--max-content-width-large); | ||
margin: 5rem auto; | ||
gap: 2rem; | ||
color: var(--text-primary); | ||
} | ||
|
||
.title { | ||
width: 40rem; | ||
color: var(--text-primary); | ||
|
||
@media (max-width: 834px) { | ||
width: 25.875rem; | ||
} | ||
|
||
@media (max-width: 425px) { | ||
width: 19.4375rem; | ||
} | ||
} | ||
|
||
.content { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-start; | ||
padding: 0.25rem; | ||
gap: 1rem; | ||
|
||
height: 30rem; | ||
|
||
& > :first-child { | ||
flex: 1; | ||
} | ||
|
||
& > :last-child { | ||
flex: 2; | ||
} | ||
|
||
& > :first-child, | ||
& > :last-child { | ||
height: 100%; | ||
} | ||
|
||
@media (max-width: 768px) { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 1.5rem; | ||
height: unset; | ||
} | ||
} |
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
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,82 @@ | ||
import { defineField } from "sanity"; | ||
|
||
import { titleID } from "studio/schemas/fields/text"; | ||
import { link } from "studio/schemas/objects/link"; | ||
|
||
export const generosityID = "generositySection"; | ||
|
||
export const generositySection = defineField({ | ||
name: generosityID, | ||
title: "Generosity", | ||
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", | ||
validation: (rule) => rule.required(), | ||
}, | ||
{ | ||
name: "description", | ||
title: "Description", | ||
description: | ||
"Enter the description that will be displayed in the smiley block.", | ||
type: "internationalizedArrayString", | ||
validation: (rule) => rule.required(), | ||
}, | ||
{ | ||
name: "handbookBlock", | ||
type: "object", | ||
|
||
fields: [ | ||
{ | ||
name: "handbookTitle", | ||
type: "internationalizedArrayString", | ||
title: "Handbook Title", | ||
description: | ||
"Title that will be displayed inside the handbook section.", | ||
initialValue: [ | ||
{ _key: "en", value: "Handbook" }, | ||
{ _key: "no", value: "Håndbok" }, | ||
], | ||
}, | ||
{ | ||
name: "handbookDescription", | ||
title: "Handbook Description", | ||
type: "internationalizedArrayString", | ||
description: | ||
"Description that will be displayed inside the handbook section.", | ||
|
||
initialValue: [ | ||
{ | ||
_key: "en", | ||
value: | ||
"Words and actions should go hand in hand. All about us, rules and more you can find in the handbook. If we change, we change the handbook.", | ||
}, | ||
{ | ||
_key: "no", | ||
value: | ||
"Ord og handling bør gå hånd i hånd. Alt om oss, regler og mer finner du i håndboken. Endrer vi på oss, endrer vi håndboken.", | ||
}, | ||
], | ||
}, | ||
|
||
{ | ||
...link, | ||
name: "handbookLink", | ||
description: | ||
"Bottom link that will be displayed inside the handbook section.", | ||
}, | ||
], | ||
}, | ||
], | ||
preview: { | ||
prepare() { | ||
return { | ||
title: "Generosity Section", | ||
}; | ||
}, | ||
}, | ||
}); |