diff --git a/bun.lockb b/bun.lockb index b2e2a0e..ad31944 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/sanity/schema.ts b/sanity/schema.ts index a8a69a9..d94fb48 100644 --- a/sanity/schema.ts +++ b/sanity/schema.ts @@ -22,7 +22,8 @@ import profile from './schemaTypes/profile' import organisation from './schemaTypes/organisation' import career from './schemaTypes/career' import role from './schemaTypes/role' +import trustee from './schemaTypes/trustee' export const schema: { types: SchemaTypeDefinition[] } = { - types: [localeString,contact,localeText,localeBlockArray,role,location,gallery,event,ayurvedicCenter,career,features,vriddhashrama, doctor,Home,fqa,facility,testimonial,section,aboutus,row,pricing,organisation,profile], + types: [localeString,contact,localeText,localeBlockArray,role,location,gallery,event,ayurvedicCenter,career,features,vriddhashrama, doctor,Home,fqa,facility,testimonial,section,aboutus,row,pricing,organisation,profile,trustee], } diff --git a/sanity/schemaTypes/organisation.ts b/sanity/schemaTypes/organisation.ts index 184d36c..b0de425 100644 --- a/sanity/schemaTypes/organisation.ts +++ b/sanity/schemaTypes/organisation.ts @@ -7,6 +7,19 @@ export default defineType({ type: 'document', icon:UsersIcon, fields: [ + defineField({ + name: 'trustees', + title: 'Trustees', + type: 'array', + validation: (Rule) => Rule.required(), + of: [ + defineField({ + name: "trustee", + title: "Trustee", + type: "trustee" + }) + ] + }), defineField({ name: 'members', title: 'Members', diff --git a/sanity/schemaTypes/trustee.ts b/sanity/schemaTypes/trustee.ts new file mode 100644 index 0000000..704e171 --- /dev/null +++ b/sanity/schemaTypes/trustee.ts @@ -0,0 +1,43 @@ +import { defineField, defineType } from 'sanity' +import { baseLanguage } from './locale' + +export default defineType({ + name: 'trustee', + title: 'Trustee', + type: 'object', + fields: [ + defineField({ + name: 'name', + title: 'Name', + type: 'localeString', + validation: (Rule) => Rule.required(), + }), + defineField({ + name: 'image', + title: 'Image', + type: 'image', + validation: (Rule) => Rule.required(), + options: { + hotspot: true, + } + }), + defineField({ + name: 'position', + title: 'Position', + type: 'localeString', + validation: (Rule) => Rule.required(), + }), + defineField({ + name: 'description', + title: 'Description', + type: 'localeText', + validation: (Rule) => Rule.required(), + }), + ], + preview: { + select: { + title: `name.${baseLanguage!.id}`, + media: 'image', + }, + }, +}) \ No newline at end of file diff --git a/src/app/(main)/[locale]/about-us/organisation/page.tsx b/src/app/(main)/[locale]/about-us/organisation/page.tsx index a0db31a..d723dea 100644 --- a/src/app/(main)/[locale]/about-us/organisation/page.tsx +++ b/src/app/(main)/[locale]/about-us/organisation/page.tsx @@ -4,11 +4,13 @@ import Heading from "~/components/Heading/Heading"; import ScrollDown from "~/components/Hero/ScrollDown"; import Profile from "~/components/Profile/Profile"; import { fetchOrganisationPage } from "~/lib/queries"; +import Reveal from "~/components/Animations/reveal"; export default async function organisor() { const t = await getTranslations("organisation"); const locale = await getLocale(); const data = await fetchOrganisationPage(locale); + console.log(data); return (
@@ -38,26 +40,36 @@ export default async function organisor() { className="content-container flex flex-col md:gap-4 gap-2" id="faculty" > + + {t("Trustee")} -
- {data.members.slice(0, 1).map((member, index) => ( +
+ {data.trustees.map((trustee, index) => ( +
+ +
+ {trustee.description} +
+
+
+ ))} -
-

{t("trusteeDescription")}

-
+ + + {t("faculty")}
- {data.members.slice(1).map((member, index) => ( + {data.members.map((member, index) => (
); -} +} \ No newline at end of file diff --git a/src/components/Career/Career.tsx b/src/components/Career/Career.tsx index f1d8144..cc877d5 100644 --- a/src/components/Career/Career.tsx +++ b/src/components/Career/Career.tsx @@ -21,7 +21,6 @@ export default function Career({ data }: { data: CareerType }) { {data.title}
- dialogRef.current?.open()} className="text-blue-600 underline cursor-pointer">{t("question")} diff --git a/src/lib/queries.ts b/src/lib/queries.ts index 0436863..50b4c3b 100644 --- a/src/lib/queries.ts +++ b/src/lib/queries.ts @@ -294,6 +294,12 @@ export async function fetchPricingPage(locale: string) { type Organisation = { + trustees: { + name: string, + position: string, + image: Image, + description: string + }[], members: { name: string, position: string, @@ -303,6 +309,12 @@ type Organisation = { export async function fetchOrganisationPage(locale: string) { const query = `*[_type == "organisation"][0]{ + "trustees":trustees[]{ + "name":${coalesce("name", locale)}, + "position":${coalesce("position", locale)}, + image, + "description":${coalesce("description",locale)} + }, "members":members[]{ "name":${coalesce("name", locale)}, "position":${coalesce("position", locale)}, @@ -314,6 +326,10 @@ export async function fetchOrganisationPage(locale: string) { return { ...page, + trustees: page.trustees.map(trustee => ({ + ...trustee, + image: urlForImage(trustee.image) + })), members: page.members.map(member => ({ ...member, image: urlForImage(member.image)