diff --git a/client/sanity.config.ts b/client/sanity.config.ts index 1f085072c..631c0d572 100644 --- a/client/sanity.config.ts +++ b/client/sanity.config.ts @@ -42,6 +42,15 @@ export default defineConfig({ S.document().schemaType("home-page").documentId("home-page") ), + S.listItem() + .title("Lodge Information") + .id("lodge-information") + .child( + S.document() + .schemaType("lodge-information") + .documentId("lodge-information") + ), + // Regular document types S.documentTypeListItem("about-item").title("About Item"), S.documentTypeListItem("contact-detail").title("Contact Detail") diff --git a/client/sanity/schema.ts b/client/sanity/schema.ts index 6142c9701..860a5b027 100644 --- a/client/sanity/schema.ts +++ b/client/sanity/schema.ts @@ -1,8 +1,9 @@ import { AboutItemSchema } from "@/models/sanity/AboutItem/Schema" import { ContactDetailSchema } from "@/models/sanity/ContactDetail/Schema" import { HomePageSchema } from "@/models/sanity/HomePage/Schema" +import { LodgeInfoSchema } from "@/models/sanity/LodgeInfo/Schema" import { type SchemaTypeDefinition } from "sanity" export const schema: { types: SchemaTypeDefinition[] } = { - types: [AboutItemSchema, HomePageSchema, ContactDetailSchema] + types: [AboutItemSchema, HomePageSchema, ContactDetailSchema, LodgeInfoSchema] } diff --git a/client/src/models/sanity/LodgeInfo/Schema.ts b/client/src/models/sanity/LodgeInfo/Schema.ts new file mode 100644 index 000000000..da2e74a58 --- /dev/null +++ b/client/src/models/sanity/LodgeInfo/Schema.ts @@ -0,0 +1,22 @@ +import { SchemaTypeDefinition, defineField } from "sanity" + +export const LodgeInfoSchema: SchemaTypeDefinition = { + name: "lodge-information", + title: "Lodge Information", + description: "What to display to the user before they enter the booking view", + type: "document", + fields: [ + defineField({ + name: "information", + description: "An overview of what the user gets out of booking the lodge", + type: "array", + of: [{ type: "block" }] + }), + defineField({ + name: "images", + description: "Images used to promote the lodge", + type: "array", + of: [{ type: "image" }] + }) + ] +} diff --git a/client/src/models/sanity/LodgeInfo/Utils.ts b/client/src/models/sanity/LodgeInfo/Utils.ts new file mode 100644 index 000000000..f38607c26 --- /dev/null +++ b/client/src/models/sanity/LodgeInfo/Utils.ts @@ -0,0 +1,2 @@ +export const LODGE_INFORMATION_GROQ_QUERY = + `[_type == "lodge-information"]` as const