From 7a9db085e007bc161b7151327b78f0dc788e3a6e Mon Sep 17 00:00:00 2001 From: Vishesh Dwivedi <150812089+Vishesh-Dwivedi-Git@users.noreply.github.com> Date: Mon, 27 Jan 2025 01:30:40 +0530 Subject: [PATCH] feat: add 4 new schemas (#16) Co-authored-by: Shardendu Mishra --- src/sanity/schemaTypes/Finance.ts | 47 +++++++++++++++++++ src/sanity/schemaTypes/building_and_works.ts | 46 ++++++++++++++++++ src/sanity/schemaTypes/cgc.ts | 46 ++++++++++++++++++ src/sanity/schemaTypes/index.ts | 8 ++++ .../schemaTypes/student_coordinators.ts | 46 ++++++++++++++++++ 5 files changed, 193 insertions(+) create mode 100644 src/sanity/schemaTypes/Finance.ts create mode 100644 src/sanity/schemaTypes/building_and_works.ts create mode 100644 src/sanity/schemaTypes/cgc.ts create mode 100644 src/sanity/schemaTypes/student_coordinators.ts diff --git a/src/sanity/schemaTypes/Finance.ts b/src/sanity/schemaTypes/Finance.ts new file mode 100644 index 0000000..af2a35e --- /dev/null +++ b/src/sanity/schemaTypes/Finance.ts @@ -0,0 +1,47 @@ +import { defineField, defineType } from 'sanity'; + +export const Finance = defineType({ + title: 'finance', + name: 'Finance', + type: 'document', + fields: [ + defineField({ + name: 'title', + title: 'Group Title', + type: 'string', + description: + 'Title of the profile group, e.g., "Members" or "Special Invitee".', + }), + defineField({ + name: 'profiles', + title: 'Profiles', + type: 'array', + of: [ + { + type: 'object', + fields: [ + defineField({ + name: 'content', + title: 'Content', + type: 'array', + of: [{ type: 'string' }], + description: 'Roles or descriptions for the profile.', + }), + defineField({ + name: 'imageURL', + title: 'Image URL', + type: 'string', + description: 'URL of the profile image (can be empty).', + }), + defineField({ + name: 'title', + title: 'Profile Name', + type: 'string', + description: 'Name of the person.', + }), + ], + }, + ], + }), + ], +}); diff --git a/src/sanity/schemaTypes/building_and_works.ts b/src/sanity/schemaTypes/building_and_works.ts new file mode 100644 index 0000000..646f8d3 --- /dev/null +++ b/src/sanity/schemaTypes/building_and_works.ts @@ -0,0 +1,46 @@ +import { defineField, defineType } from 'sanity'; + +export const building_and_works = defineType({ + title: 'Building and Works', + name: 'buildingAndWorks', + type: 'document', + fields: [ + defineField({ + name: 'title', + title: 'Title', + type: 'string', + description: 'Group title (optional)', + }), + defineField({ + name: 'profiles', + title: 'Profiles', + type: 'array', + of: [ + { + type: 'object', + fields: [ + defineField({ + name: 'content', + title: 'Content', + type: 'array', + of: [{ type: 'string' }], + description: 'Roles or descriptions for the profile', + }), + defineField({ + name: 'imageURL', + title: 'Image URL', + type: 'url', + description: 'Profile image URL (optional)', + }), + defineField({ + name: 'title', + title: 'Profile Name', + type: 'string', + description: 'Name of the person', + }), + ], + }, + ], + }), + ], +}); diff --git a/src/sanity/schemaTypes/cgc.ts b/src/sanity/schemaTypes/cgc.ts new file mode 100644 index 0000000..39a4196 --- /dev/null +++ b/src/sanity/schemaTypes/cgc.ts @@ -0,0 +1,46 @@ +import { defineField, defineType } from 'sanity'; + +export const cgc = defineType({ + title: 'cgc', + name: 'Cgc', + type: 'document', + fields: [ + defineField({ + name: 'title', + title: 'Title', + type: 'string', + description: 'Group title (can be empty)', + }), + defineField({ + name: 'profiles', + title: 'Profiles', + type: 'array', + of: [ + { + type: 'object', + fields: [ + defineField({ + name: 'content', + title: 'Content', + type: 'array', + of: [{ type: 'string' }], + description: 'Roles or descriptions for the profile', + }), + defineField({ + name: 'imageURL', + title: 'Image URL', + type: 'string', + description: 'URL of the profile image', + }), + defineField({ + name: 'title', + title: 'Profile Name', + type: 'string', + description: 'Name of the person', + }), + ], + }, + ], + }), + ], +}); diff --git a/src/sanity/schemaTypes/index.ts b/src/sanity/schemaTypes/index.ts index 6a36d75..4bf0e7e 100644 --- a/src/sanity/schemaTypes/index.ts +++ b/src/sanity/schemaTypes/index.ts @@ -38,6 +38,10 @@ import { ContactData, ContactInf, } from './generalInfo/ContactInfo'; +import { building_and_works } from './building_and_works'; +import { cgc } from './cgc'; +import { Finance } from './Finance'; +import { student_coordinators } from './student_coordinators'; export const schema: { types: SchemaTypeDefinition[] } = { types: [ @@ -82,5 +86,9 @@ export const schema: { types: SchemaTypeDefinition[] } = { MainCarouselImage, ProgramCards, ProgramsType, + building_and_works, + cgc, + Finance, + student_coordinators, ], }; diff --git a/src/sanity/schemaTypes/student_coordinators.ts b/src/sanity/schemaTypes/student_coordinators.ts new file mode 100644 index 0000000..f816f43 --- /dev/null +++ b/src/sanity/schemaTypes/student_coordinators.ts @@ -0,0 +1,46 @@ +import { defineField, defineType } from 'sanity'; + +export const student_coordinators = defineType({ + title: 'student_coordinators', + name: 'student_Coordinators', + type: 'document', + fields: [ + defineField({ + name: 'title', + title: 'Title', + type: 'string', + description: 'Group title (can be empty)', + }), + defineField({ + name: 'profiles', + title: 'Profiles', + type: 'array', + of: [ + { + type: 'object', + fields: [ + defineField({ + name: 'content', + title: 'Content', + type: 'array', + of: [{ type: 'string' }], + description: 'Roles or descriptions for the profile', + }), + defineField({ + name: 'imageURL', + title: 'Image URL', + type: 'string', + description: 'Profile image URL', + }), + defineField({ + name: 'title', + title: 'Profile Name', + type: 'string', + description: 'Name of the person', + }), + ], + }, + ], + }), + ], +});