Skip to content

Commit

Permalink
Merge pull request #496 from varianter/feature/v3-shot-salary-calcula…
Browse files Browse the repository at this point in the history
…tor-option

v3 - schema option to toggle salary calculator
  • Loading branch information
mathiazom authored Aug 21, 2024
2 parents f10c3f2 + 79e2765 commit 617eff3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
12 changes: 6 additions & 6 deletions studio/schemas/deskStructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { soMeLinksID } from "./documents/socialMediaProfiles";
import { siteSettingsID } from "./documents/siteSettings";
import { postId } from "./documents/post";
import { legalDocumentID } from "./documents/legalDocuments";
import { salaryAndBenefitsId } from './documents/salaryAndBenefits';
import { salaryAndBenefitsId } from "./documents/salaryAndBenefits";

export default (S: StructureBuilder) =>
S.list()
Expand All @@ -27,7 +27,7 @@ export default (S: StructureBuilder) =>
S.document()
.schemaType(siteSettingsID)
.documentId(siteSettingsID)
.title("Site Settings")
.title("Site Settings"),
),
S.listItem()
.title("Legal Documents")
Expand All @@ -44,7 +44,7 @@ export default (S: StructureBuilder) =>
S.document()
.schemaType("navigationManager")
.documentId("navigationManager")
.title("Navigation Manager")
.title("Navigation Manager"),
),
S.listItem()
.title("Pages")
Expand All @@ -64,13 +64,13 @@ export default (S: StructureBuilder) =>
S.document()
.schemaType(blogId)
.documentId(blogId)
.title("Blog Overview & Settings")
.title("Blog Overview & Settings"),
),
S.listItem()
.title("Posts")
.icon(ComposeIcon)
.child(S.documentTypeList(postId).title("Posts")),
])
]),
),
S.listItem()
.title("Salary and Benefits")
Expand All @@ -79,6 +79,6 @@ export default (S: StructureBuilder) =>
S.document()
.schemaType(salaryAndBenefitsId)
.documentId(salaryAndBenefitsId)
.title("Salary and Benefits")
.title("Salary and Benefits"),
),
]);
27 changes: 17 additions & 10 deletions studio/schemas/documents/salaryAndBenefits.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineField, defineType } from 'sanity';
import { pageSlug } from '../schemaTypes/slug';
import seo from '../objects/seo';
import { title } from '../fields/text';
import { benefitId } from './benefit';
import { defineField, defineType } from "sanity";
import { pageSlug } from "../schemaTypes/slug";
import seo from "../objects/seo";
import { title } from "../fields/text";
import { benefitId } from "./benefit";

export const salaryAndBenefitsId = "salaryAndBenefits";

Expand All @@ -14,14 +14,21 @@ const salaryAndBenefits = defineType({
title,
pageSlug,
seo,
defineField(({
defineField({
name: "showSalaryCalculator",
title: "Show Salary Calculator",
description: "Should the salary calculator be visible on the page?",
type: "boolean",
initialValue: true,
}),
defineField({
name: "benefits",
title: "Benefits",
description: "Manage benefits for the salary and benefits page",
type: "array",
of: [{ type: benefitId }]
}))
]
of: [{ type: benefitId }],
}),
],
});

export default salaryAndBenefits;
export default salaryAndBenefits;

0 comments on commit 617eff3

Please sign in to comment.