Skip to content

Commit

Permalink
feat: marketing homepage (#28)
Browse files Browse the repository at this point in the history
* feat: add new home web sections

* feat: add statsSection to home web
  • Loading branch information
flagrede authored Mar 13, 2023
1 parent ce1971a commit 4065dbd
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deskStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
]),
),
]);
Expand Down
31 changes: 31 additions & 0 deletions schemas/documents/shared/statCard.js
Original file line number Diff line number Diff line change
@@ -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(),
},
],
};
18 changes: 18 additions & 0 deletions schemas/documents/www/homePageWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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),
},
],
};
6 changes: 6 additions & 0 deletions schemas/objects/sections/homePageWeb/homeFoldSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ export default {
type: 'string',
validation: Rule => Rule.required(),
},
{
title: 'Image',
name: 'image',
type: 'customImage',
validation: Rule => Rule.required(),
},
],
};
25 changes: 25 additions & 0 deletions schemas/objects/sections/homePageWeb/partnersSection.js
Original file line number Diff line number Diff line change
@@ -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),
},
],
};
31 changes: 31 additions & 0 deletions schemas/objects/sections/homePageWeb/statsSection.js
Original file line number Diff line number Diff line change
@@ -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),
},
],
};
8 changes: 8 additions & 0 deletions schemas/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -269,6 +273,9 @@ export default createSchema({
homePageTopSection,
homePageWeb,
homeValuesSection,
homeWebEcologicalCreditCardsSection,
homeWebPartnersSection,
homeWebStatsSection,
imageBoldTextLabel,
imageCustomBody,
imageGridItem,
Expand Down Expand Up @@ -333,6 +340,7 @@ export default createSchema({
seo,
sharedSections,
soldOutProjects,
statCard,
stepCard,
stepCardSection,
tag,
Expand Down

0 comments on commit 4065dbd

Please sign in to comment.