diff --git a/deskStructure.js b/deskStructure.js index 23809d5..e6fa09c 100644 --- a/deskStructure.js +++ b/deskStructure.js @@ -281,6 +281,10 @@ export default () => { .title('Partner') .schemaType('partner') .child(S.documentTypeList('partner').title('Partner')), + S.listItem() + .title('Stat Card') + .schemaType('statCard') + .child(S.documentTypeList('statCard').title('Stat Card')), ]), ), ]); diff --git a/schemas/documents/shared/statCard.js b/schemas/documents/shared/statCard.js new file mode 100644 index 0000000..2f0c30a --- /dev/null +++ b/schemas/documents/shared/statCard.js @@ -0,0 +1,31 @@ +export default { + name: 'statCard', + type: 'document', + title: 'Stat Card', + fields: [ + { + title: 'Label', + name: 'label', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Stat', + name: 'stat', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Description', + name: 'description', + type: 'customPortableText', + validation: Rule => Rule.required(), + }, + { + title: 'Image', + name: 'image', + type: 'customImage', + validation: Rule => Rule.required(), + }, + ], +}; diff --git a/schemas/documents/www/homePageWeb.js b/schemas/documents/www/homePageWeb.js index 7dc9908..3b2862d 100644 --- a/schemas/documents/www/homePageWeb.js +++ b/schemas/documents/www/homePageWeb.js @@ -16,6 +16,24 @@ export default { title: 'Marketplace Section', validation: Rule => Rule.required(), }, + { + name: 'homeWebPartnersSection', + type: 'homeWebPartnersSection', + title: 'Partners Section', + validation: Rule => Rule.required(), + }, + { + name: 'homeWebEcologicalCreditCardsSection', + type: 'homeWebEcologicalCreditCardsSection', + title: 'Ecological Credit Cards Section', + validation: Rule => Rule.required(), + }, + { + name: 'homeWebStatsSection', + type: 'homeWebStatsSection', + title: 'Stats Cards Section', + validation: Rule => Rule.required(), + }, { name: 'bannerTextSection', type: 'titleImageCustomBody', diff --git a/schemas/objects/sections/homePageWeb/ecologicalCreditCardsSection.js b/schemas/objects/sections/homePageWeb/ecologicalCreditCardsSection.js new file mode 100644 index 0000000..9fa85f6 --- /dev/null +++ b/schemas/objects/sections/homePageWeb/ecologicalCreditCardsSection.js @@ -0,0 +1,25 @@ +export default { + type: 'object', + title: 'Ecological Credit Cards Section', + name: 'homeWebEcologicalCreditCardsSection', + fields: [ + { + title: 'Title', + name: 'title', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Cards', + name: 'cards', + type: 'array', + of: [ + { + type: 'reference', + to: [{ type: 'ecologicalCreditCard' }], + }, + ], + validation: Rule => Rule.required().min(1), + }, + ], +}; diff --git a/schemas/objects/sections/homePageWeb/homeFoldSection.js b/schemas/objects/sections/homePageWeb/homeFoldSection.js index 749f7c2..c40d862 100644 --- a/schemas/objects/sections/homePageWeb/homeFoldSection.js +++ b/schemas/objects/sections/homePageWeb/homeFoldSection.js @@ -15,5 +15,11 @@ export default { type: 'string', validation: Rule => Rule.required(), }, + { + title: 'Image', + name: 'image', + type: 'customImage', + validation: Rule => Rule.required(), + }, ], }; diff --git a/schemas/objects/sections/homePageWeb/partnersSection.js b/schemas/objects/sections/homePageWeb/partnersSection.js new file mode 100644 index 0000000..3fdefab --- /dev/null +++ b/schemas/objects/sections/homePageWeb/partnersSection.js @@ -0,0 +1,25 @@ +export default { + type: 'object', + title: 'Partners Section', + name: 'homeWebPartnersSection', + fields: [ + { + title: 'Title', + name: 'title', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Partners', + name: 'partners', + type: 'array', + of: [ + { + type: 'reference', + to: [{ type: 'partner' }], + }, + ], + validation: Rule => Rule.required().min(1), + }, + ], +}; diff --git a/schemas/objects/sections/homePageWeb/statsSection.js b/schemas/objects/sections/homePageWeb/statsSection.js new file mode 100644 index 0000000..94384b1 --- /dev/null +++ b/schemas/objects/sections/homePageWeb/statsSection.js @@ -0,0 +1,31 @@ +export default { + type: 'object', + title: 'Stats Section', + name: 'homeWebStatsSection', + fields: [ + { + title: 'Label', + name: 'label', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Title', + name: 'title', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Stats Cards', + name: 'cards', + type: 'array', + of: [ + { + type: 'reference', + to: [{ type: 'statCard' }], + }, + ], + validation: Rule => Rule.required().min(1), + }, + ], +}; diff --git a/schemas/schema.js b/schemas/schema.js index 8c6dcc0..5b73b94 100644 --- a/schemas/schema.js +++ b/schemas/schema.js @@ -43,6 +43,7 @@ import projectActivity from './documents/shared/projectActivity'; import project from './documents/shared/project'; import featuredProjectCard from './documents/shared/featuredProjectCard'; import partner from './documents/shared/partner'; +import statCard from './documents/shared/statCard'; // Object types import heroSection from './objects/sections/heroSection'; @@ -180,6 +181,9 @@ import buyersFeaturedProjectCardsSection from './objects/sections/buyersPage/fea import buyersPartnersSection from './objects/sections/buyersPage/partnersSection'; import actionCard from './objects/cards/actionCard'; import infoCard from './objects/cards/infoCard'; +import homeWebPartnersSection from './objects/sections/homePageWeb/partnersSection'; +import homeWebEcologicalCreditCardsSection from './objects/sections/homePageWeb/ecologicalCreditCardsSection'; +import homeWebStatsSection from './objects/sections/homePageWeb/statsSection'; // Then we give our schema to the builder and provide the result to Sanity export default createSchema({ @@ -269,6 +273,9 @@ export default createSchema({ homePageTopSection, homePageWeb, homeValuesSection, + homeWebEcologicalCreditCardsSection, + homeWebPartnersSection, + homeWebStatsSection, imageBoldTextLabel, imageCustomBody, imageGridItem, @@ -333,6 +340,7 @@ export default createSchema({ seo, sharedSections, soldOutProjects, + statCard, stepCard, stepCardSection, tag,