-
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
8 changed files
with
195 additions
and
1 deletion.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/components/sections/employeeHighlight/EmployeeHighlight.tsx
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,34 @@ | ||
import { SanityImage } from "src/components/image/SanityImage"; | ||
import Text from "src/components/text/Text"; | ||
import { EmployeeHighlightSection } from "studio/lib/interfaces/pages"; | ||
|
||
import styles from "./employeeHighlight.module.css"; | ||
|
||
export interface EmployeeHighlightProps { | ||
section: EmployeeHighlightSection; | ||
} | ||
|
||
export default function EmployeeHighLight({ section }: EmployeeHighlightProps) { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<div className={styles.image}> | ||
<SanityImage image={section.employeePhoto} /> | ||
</div> | ||
<div> | ||
<div className={styles.titleSection}> | ||
<Text type={"h5"} className={styles.title}> | ||
{section.basicTitle} | ||
</Text> | ||
<div className={styles.nameContainer}> | ||
<Text type={"h2"} className={styles.name}> | ||
{section.name} | ||
</Text> | ||
</div> | ||
</div> | ||
<Text type={"bodyNormal"} className={styles.description}> | ||
{section.description} | ||
</Text> | ||
</div> | ||
</div> | ||
); | ||
} |
83 changes: 83 additions & 0 deletions
83
src/components/sections/employeeHighlight/employeeHighlight.module.css
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,83 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
padding: 2rem 0.375rem 0.375rem 0.375rem; | ||
max-width: 68rem; | ||
margin: 5rem auto; | ||
border-radius: 0.375rem; | ||
gap: 1.5rem; | ||
color: var(--text-primary); | ||
|
||
@media (max-width: 1024px) { | ||
flex-direction: column; | ||
} | ||
} | ||
|
||
.titleSection { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 0; | ||
} | ||
|
||
.title { | ||
padding: 0.25rem 1rem; | ||
border-radius: 0.25rem 0.25rem 0rem 0rem; | ||
background-color: var(--Violet-700); | ||
color: var(--text-primary-light); | ||
} | ||
|
||
.nameContainer { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
padding: 0.25rem; | ||
gap: 0.5rem; | ||
border-radius: 0rem 0.25rem 0.25rem 0.25rem; | ||
background: var(--Purple-700, #7022d6); | ||
} | ||
|
||
.name { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
padding: 0.75rem 1.25rem 0.625rem 1.25rem; | ||
border: 1px solid var(--Violet-700); | ||
border-radius: 1.5rem; | ||
background-color: var(--text-primary-light); | ||
} | ||
|
||
.description { | ||
width: 100%; | ||
text-wrap: wrap; | ||
} | ||
|
||
.image { | ||
border-radius: 0.75rem; | ||
overflow: hidden; | ||
|
||
min-width: 150px; | ||
max-width: 15rem; | ||
|
||
@media (min-width: 640px) { | ||
min-width: 240px; | ||
max-width: 21.25rem; | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
min-width: 260px; | ||
max-width: 21.25rem; | ||
} | ||
|
||
@media (min-width: 1400px) { | ||
min-width: 360px; | ||
max-width: 27.5rem; | ||
} | ||
|
||
@media (min-width: 1800px) { | ||
min-width: 460px; | ||
max-width: 33.75rem; | ||
} | ||
} |
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,56 @@ | ||
import { defineField } from "sanity"; | ||
|
||
import { isInternationalizedString } from "studio/lib/interfaces/global"; | ||
import { titleID } from "studio/schemas/fields/text"; | ||
import { firstTranslation } from "studio/utils/i18n"; | ||
|
||
export const employeeHighlightID = "employeeHighlight"; | ||
|
||
export const employeeHighlightSection = defineField({ | ||
name: employeeHighlightID, | ||
title: "Employee Highlight", | ||
type: "object", | ||
fields: [ | ||
{ | ||
name: titleID.basic, | ||
type: "internationalizedArrayString", | ||
title: "Title", | ||
description: "The title/prefix that will appear above the name block.", | ||
}, | ||
{ | ||
name: "name", | ||
type: "string", | ||
title: "Name", | ||
description: "The name of the employee.", | ||
}, | ||
{ | ||
name: "description", | ||
type: "internationalizedArrayString", | ||
title: "Description", | ||
description: "The body text in the section.", | ||
}, | ||
{ | ||
name: "employeePhoto", | ||
type: "image", | ||
title: "Employee photo", | ||
description: "A photo of the employee,", | ||
}, | ||
], | ||
preview: { | ||
select: { | ||
title: "basicTitle", | ||
name: "name", | ||
}, | ||
prepare({ title, name }) { | ||
if (!isInternationalizedString(title)) { | ||
throw new TypeError( | ||
`Expected 'title' to be InternationalizedString, was ${typeof title}`, | ||
); | ||
} | ||
return { | ||
title: `${firstTranslation(title) ?? ""} ${name}`, | ||
subtitle: "Employee highlight", | ||
}; | ||
}, | ||
}, | ||
}); |