Skip to content

Commit

Permalink
feat(salaryAndBenefits): add Norway only disclaimer to calculator toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Aug 28, 2024
1 parent 98c36f4 commit efdb4e9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions studio/components/MultiLineDescription.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { HTMLProps } from "react";

const MultiLineDescription = ({
lines,
...props
}: { lines: string[] } & HTMLProps<HTMLDivElement>) => {
return (
<div {...props}>
{lines.map((l, i) => (
<p key={i}>{l}</p>
))}
</div>
);
};

export default MultiLineDescription;
9 changes: 8 additions & 1 deletion studio/schemas/documents/salaryAndBenefits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { titleSlug } from "../schemaTypes/slug";
import seo from "../objects/seo";
import { title } from "../fields/text";
import { benefitId } from "./benefit";
import MultiLineDescription from "../../components/MultiLineDescription";

export const salaryAndBenefitsId = "salaryAndBenefits";

Expand All @@ -17,7 +18,13 @@ const salaryAndBenefits = defineType({
defineField({
name: "showSalaryCalculator",
title: "Show Salary Calculator",
description: "Should the salary calculator be visible on the page?",
description: MultiLineDescription({
lines: [
"Should the salary calculator be visible on the page?",
"🇳🇴 Only for Norway",
],
style: { paddingBottom: "0.35rem" },
}),
type: "boolean",
initialValue: true,
}),
Expand Down

0 comments on commit efdb4e9

Please sign in to comment.