-
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
4 changed files
with
46 additions
and
20 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
src/compensations/components/benefitsByLocation/BenefitsByLocation.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,29 @@ | ||
import { Benefit } from "studio/lib/payloads/compensations"; | ||
import Text from "src/components/text/Text"; | ||
import { RichText } from "src/components/richText/RichText"; | ||
import styles from "./benefitsByLocation.module.css"; | ||
|
||
interface BenefitsByLocationProps { | ||
locationId: string; | ||
benefits?: Benefit[] | any; | ||
} | ||
|
||
export default function BenefitsByLocation({ | ||
locationId, | ||
benefits, | ||
}: BenefitsByLocationProps) { | ||
const selectedBenefitsGroup = | ||
benefits.find((location: any) => location.location._ref === locationId) | ||
?.benefitsGroup || []; | ||
|
||
return ( | ||
<div className={styles.benefits}> | ||
{selectedBenefitsGroup.map((benefit: Benefit) => ( | ||
<div key={benefit._key} className={styles.benefitWrapper}> | ||
<Text type="h2">{benefit.basicTitle}</Text> | ||
<RichText value={benefit.richText} /> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/compensations/components/benefitsByLocation/benefitsByLocation.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,12 @@ | ||
.benefits { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5rem; | ||
max-width: var(--max-content-width-medium); | ||
} | ||
|
||
.benefitWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} |