-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: merge pull request #9 from phantomsoldierking/main
feat(schemas): add schemas for contactInfo, annual-report, events, gallery, homepage
- Loading branch information
Showing
6 changed files
with
406 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { FileTextIcon } from 'lucide-react'; | ||
import { defineField, defineType } from 'sanity'; | ||
|
||
export const AnnualReport = defineType({ | ||
name: 'annualReport', | ||
title: 'Annual Report', | ||
type: 'document', | ||
icon: FileTextIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'issueUrl', | ||
title: 'Issue URL', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'id', | ||
title: 'ID', | ||
type: 'number', | ||
validation: (Rule) => Rule.required().integer(), | ||
}), | ||
defineField({ | ||
name: 'displayText', | ||
title: 'Display Text', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'previewImg', | ||
title: 'Preview Image', | ||
type: 'image', | ||
options: { | ||
hotspot: true, | ||
}, | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { UserIcon } from 'lucide-react'; | ||
import { defineField, defineType } from 'sanity'; | ||
import { TagIcon } from 'lucide-react'; | ||
import { DatabaseIcon } from 'lucide-react'; | ||
|
||
export const ContactInf = defineType({ | ||
name: 'contact', | ||
title: 'Contact', | ||
type: 'document', | ||
icon: UserIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'name', | ||
title: 'Name', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'designation', | ||
title: 'Designation', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'contactNumber', | ||
title: 'Contact Number', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'category', | ||
title: 'Category', | ||
type: 'reference', | ||
to: [{ type: 'contactCategory' }], | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); | ||
|
||
|
||
export const ContactCategory = defineType({ | ||
name: 'contactCategory', | ||
title: 'Contact Category', | ||
type: 'document', | ||
icon: TagIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'id', | ||
title: 'ID', | ||
type: 'number', | ||
validation: (Rule) => Rule.required().integer(), | ||
}), | ||
defineField({ | ||
name: 'category', | ||
title: 'Category', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); | ||
|
||
|
||
export const ContactData = defineType({ | ||
name: 'contactData', | ||
title: 'Contact Data', | ||
type: 'document', | ||
icon: DatabaseIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'generalQueries', | ||
title: 'General Queries', | ||
type: 'array', | ||
of: [{ type: 'reference', to: [{ type: 'contact' }] }], | ||
}), | ||
defineField({ | ||
name: 'hostelRelatedQueries', | ||
title: 'Hostel Related Queries', | ||
type: 'array', | ||
of: [{ type: 'reference', to: [{ type: 'contact' }] }], | ||
}), | ||
defineField({ | ||
name: 'academicQueries', | ||
title: 'Academic Queries', | ||
type: 'array', | ||
of: [{ type: 'reference', to: [{ type: 'contact' }] }], | ||
}), | ||
defineField({ | ||
name: 'careerGuidanceCell', | ||
title: 'Career Guidance Cell', | ||
type: 'array', | ||
of: [{ type: 'reference', to: [{ type: 'contact' }] }], | ||
}), | ||
defineField({ | ||
name: 'feeRelatedQueries', | ||
title: 'Fee Related Queries', | ||
type: 'array', | ||
of: [{ type: 'reference', to: [{ type: 'contact' }] }], | ||
}), | ||
defineField({ | ||
name: 'scholarshipLoansQueries', | ||
title: 'Scholarship/Loans Queries', | ||
type: 'array', | ||
of: [{ type: 'reference', to: [{ type: 'contact' }] }], | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import { CalendarIcon } from 'lucide-react'; | ||
import { defineField, defineType } from 'sanity'; | ||
|
||
export const EventInfo = defineType({ | ||
name: 'eventInf', | ||
title: 'Event Information', | ||
type: 'document', | ||
icon: CalendarIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'id', | ||
title: 'ID', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'href', | ||
title: 'Href', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'text', | ||
title: 'Text', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'timestamp', | ||
title: 'Timestamp', | ||
type: 'datetime', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'allImage', | ||
title: 'All Images', | ||
type: 'array', | ||
of: [{ type: 'image', options: { hotspot: true } }], | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'details', | ||
title: 'Details', | ||
type: 'object', | ||
fields: [ | ||
defineField({ | ||
name: 'startDate', | ||
title: 'Start Date', | ||
type: 'datetime', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'endDate', | ||
title: 'End Date', | ||
type: 'datetime', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'ticketPrice', | ||
title: 'Ticket Price', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}), | ||
defineField({ | ||
name: 'venue', | ||
title: 'Venue', | ||
type: 'object', | ||
fields: [ | ||
defineField({ | ||
name: 'place', | ||
title: 'Place', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'street', | ||
title: 'Street', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'city', | ||
title: 'City', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}), | ||
defineField({ | ||
name: 'organiser', | ||
title: 'Organiser', | ||
type: 'object', | ||
fields: [ | ||
defineField({ | ||
name: 'name', | ||
title: 'Name', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'designation', | ||
title: 'Designation', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'contact', | ||
title: 'Contact', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}), | ||
defineField({ | ||
name: 'aboutEvent', | ||
title: 'About Event', | ||
type: 'text', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ImageIcon } from 'lucide-react'; | ||
import { defineField, defineType } from 'sanity'; | ||
|
||
export const Gallery = defineType({ | ||
name: 'gallery', | ||
title: 'Gallery', | ||
type: 'document', | ||
icon: ImageIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'url', | ||
title: 'Image URL', | ||
type: 'image', | ||
options: { hotspot: true }, | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'caption', | ||
title: 'Caption', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { ImageIcon } from 'lucide-react'; | ||
import { CarIcon } from 'lucide-react'; // Replace with an appropriate icon | ||
import { ClipboardIcon } from 'lucide-react'; // Replace with an appropriate icon | ||
|
||
import { defineField, defineType } from 'sanity'; | ||
|
||
export const MainCarouselImage = defineType({ | ||
name: 'mainCarouselImage', | ||
title: 'Main Carousel Image', | ||
type: 'document', | ||
icon: ImageIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'url', | ||
title: 'Image URL', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'caption', | ||
title: 'Caption', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'link', | ||
title: 'Link', | ||
type: 'url', | ||
}), | ||
], | ||
}); | ||
|
||
|
||
export const ProgramCards = defineType({ | ||
name: 'programCards', | ||
title: 'Program Cards', | ||
type: 'document', | ||
icon: CarIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'image', | ||
title: 'Image URL', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'link', | ||
title: 'Link', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'Header1', | ||
title: 'Header 1', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'Header2', | ||
title: 'Header 2', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); | ||
|
||
export const ProgramsType = defineType({ | ||
name: 'programsType', | ||
title: 'Programs Type', | ||
type: 'document', | ||
icon: ClipboardIcon, | ||
fields: [ | ||
defineField({ | ||
name: 'image', | ||
title: 'Image URL', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'title', | ||
title: 'Title', | ||
type: 'string', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'description', | ||
title: 'Description', | ||
type: 'text', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: 'link', | ||
title: 'Link', | ||
type: 'url', | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}); |
Oops, something went wrong.