Skip to content

Commit

Permalink
feat(feat): added schemas for 6 data such as Jobs, Member etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ANAS727189 committed Jan 14, 2025
2 parents cd4e0b7 + faa9223 commit b2add97
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/sanity/schemaTypes/CampusData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineType, defineField } from 'sanity';
import { HomeIcon } from 'lucide-react';
export const campusData = defineType({
name: 'campusData',
title: 'Campus Data',
type: 'document',
icon: HomeIcon,
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'Title of the Card',
}),
defineField({
name: 'href',
title: 'Href',
type: 'string',
description: 'Link where the card will redirect when clicked',
}),
defineField({
name: 'image',
title: 'Image',
type: 'image',
description: 'Image to display on the card',
}),
],
});
35 changes: 35 additions & 0 deletions src/sanity/schemaTypes/Facilities.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { defineType, defineField } from 'sanity';

export const facilities = defineType({
name: 'facility',
title: 'Facility',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'The title of the facility.',
}),
defineField({
name: 'blockName',
title: 'Block Name',
type: 'string',
description:
'The name of the block associated with the facility. for example- e block',
}),
defineField({
name: 'items',
title: 'Items',
type: 'array',
of: [{ type: 'string' }],
description: 'A list of items associated with the facility.',
}),
defineField({
name: 'imageUrl',
title: 'Image URL',
type: 'image',
description: 'The image associated with the facility.',
}),
],
});
48 changes: 48 additions & 0 deletions src/sanity/schemaTypes/FormerBoardOfGovernor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { defineField, defineType } from 'sanity';
import { HomeIcon } from 'lucide-react';

export const formerBoardOfGovernor = defineType({
name: 'formerBoardOfGovernor',
title: 'Former Board Of Governor',
type: 'document',
icon: HomeIcon,
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'Title of the profile group',
}),
defineField({
name: 'profiles',
title: 'Profiles',
type: 'array',
of: [
{
type: 'object',
fields: [
defineField({
name: 'title',
title: 'Profile Title',
type: 'string',
description: 'Title of the profile',
}),
defineField({
name: 'content',
title: 'Content',
type: 'array',
of: [{ type: 'string' }],
description: 'Content of the profile',
}),
defineField({
name: 'imageURL',
title: 'Image URL',
type: 'string',
description: 'URL of the profile image',
}),
],
},
],
}),
],
});
39 changes: 39 additions & 0 deletions src/sanity/schemaTypes/KrcData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineType, defineField } from 'sanity';

export const krcData = defineType({
name: 'krcData',
title: 'Krc Data',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'The title of the link data.',
}),
defineField({
name: 'description',
title: 'Description',
type: 'string',
description: 'A description for the link data.',
}),
defineField({
name: 'accessInfo',
title: 'Access Info',
type: 'string',
description: 'Information about accessing the resource.',
}),
defineField({
name: 'buttonText',
title: 'Button Text',
type: 'string',
description: 'The text displayed on the button.',
}),
defineField({
name: 'link',
title: 'Link',
type: 'url',
description: 'The URL for the link.',
}),
],
});
39 changes: 39 additions & 0 deletions src/sanity/schemaTypes/KrcDataTel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineType, defineField } from 'sanity';

export const krcDataTel = defineType({
name: 'krcDataTEL',
title: 'Krc Data TEL(First three)',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'The title of the link data.',
}),
defineField({
name: 'description',
title: 'Description',
type: 'string',
description: 'A description for the link data.',
}),
defineField({
name: 'accessInfo',
title: 'Access Info',
type: 'string',
description: 'Information about accessing the resource.',
}),
defineField({
name: 'buttonText',
title: 'Button Text',
type: 'string',
description: 'The text displayed on the button.',
}),
defineField({
name: 'link',
title: 'Link',
type: 'url',
description: 'The URL for the link.',
}),
],
});
57 changes: 57 additions & 0 deletions src/sanity/schemaTypes/KrcDataTelFull.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { defineType, defineField } from 'sanity';

export const krcDataTelFull = defineType({
name: 'krcDataTelFull',
title: 'Krc Data TEL(Full)',
type: 'document',
fields: [
defineField({
name: 'heading',
title: 'Heading',
type: 'string',
description: 'The heading of the group of cards',
}),
defineField({
name: 'card',
title: 'Card',
type: 'array',
of: [
{
type: 'object',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'The title of the link data.',
}),
defineField({
name: 'description',
title: 'Description',
type: 'string',
description: 'A description for the link data.',
}),
defineField({
name: 'accessInfo',
title: 'Access Info',
type: 'string',
description: 'Information about accessing the resource.',
}),
defineField({
name: 'buttonText',
title: 'Button Text',
type: 'string',
description: 'The text displayed on the button.',
}),
defineField({
name: 'link',
title: 'Link',
type: 'url',
description: 'The URL for the link.',
}),
],
},
],
}),
],
});
25 changes: 25 additions & 0 deletions src/sanity/schemaTypes/Research.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineField, defineType } from 'sanity';

export const research = defineType({
title: 'Research Profiles',
name: 'profiles',
type: 'document',
fields: [
defineField({
title: 'Title',
name: 'title',
type: 'string',
}),
defineField({
title: 'Image Url',
name: 'imageUrl',
type: 'string',
}),
defineField({
title: 'More Details',
name: 'content',
type: 'array',
of: [{ type: 'string' }],
}),
],
});
15 changes: 14 additions & 1 deletion src/sanity/schemaTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ import { cseDetail } from './CSEAcademics';
import { eceDetail } from './ECEAcademics';
import { dsaiDetail } from './DSAIAcademics';
import { Credit } from './Credits';
import { research } from './Research';
import { formerBoardOfGovernor } from './FormerBoardOfGovernor';
import { campusData } from './CampusData';
import { facilities } from './Facilities';
import { krcData } from './KrcData';
import { krcDataTel } from './KrcDataTel';
import { krcDataTelFull } from './KrcDataTelFull';
import { Jobs } from './Jobs';
import { Member, FacultyAdvisor, Team, Issues } from './Magazine';
import { Club } from './Members';
Expand All @@ -25,13 +32,20 @@ import { Tender } from './Tenders';

export const schema: { types: SchemaTypeDefinition[] } = {
types: [
research,
campusData,
facilities,
krcData,
krcDataTel,
krcDataTelFull,
facultyType,
senate,
staff,
chairPerson,
former,
visitor,
boardOfGovernor,
formerBoardOfGovernor,
announcementType,
linksStructure,
seatStructure,
Expand All @@ -42,7 +56,6 @@ export const schema: { types: SchemaTypeDefinition[] } = {
dsaiDetail,
Credit,

// Updated be me
Jobs,
Member,
FacultyAdvisor,
Expand Down

0 comments on commit b2add97

Please sign in to comment.