Skip to content

Commit

Permalink
feat: add Tebu Banner schema (#67)
Browse files Browse the repository at this point in the history
* feat: add tebu banner schema

* feat: make all fields configurable
  • Loading branch information
flagrede authored Oct 1, 2024
1 parent ee4327e commit 50c5981
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
25 changes: 23 additions & 2 deletions deskStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,19 @@ export default S =>
S.listItem()
.title('Credit Class Prefinance Timeline Status')
.schemaType('classPrefinanceTimelineStatus')
.child(S.documentTypeList('classPrefinanceTimelineStatus').title('Credit Class Prefinance Timeline Status')),
.child(
S.documentTypeList('classPrefinanceTimelineStatus').title(
'Credit Class Prefinance Timeline Status',
),
),
S.listItem()
.title('Project Class Prefinance Timeline Status')
.schemaType('projectPrefinanceTimelineStatus')
.child(S.documentTypeList('projectPrefinanceTimelineStatus').title('Project Class Prefinance Timeline Status')),
.child(
S.documentTypeList('projectPrefinanceTimelineStatus').title(
'Project Class Prefinance Timeline Status',
),
),
S.listItem()
.title('Featured Project Card')
.schemaType('featuredProjectCard')
Expand Down Expand Up @@ -325,4 +333,17 @@ export default S =>
.child(S.documentTypeList('program').title('Program')),
]),
),
// Terrasos
S.listItem()
.title('Terrasos')
.child(
S.list()
.title('Terrasos')
.items([
S.listItem()
.title('Tebu Banner')
.schemaType('tebuBanner')
.child(S.document().schemaType('tebuBanner')),
]),
),
]);
25 changes: 25 additions & 0 deletions schemas/documents/terrasos/tebuBanner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default {
name: 'tebuBanner',
type: 'document',
title: 'Tebu Banner',
fields: [
{
title: 'Content',
name: 'content',
type: 'customPortableText',
validation: Rule => Rule.required(),
},
{
title: 'Learn more link',
name: 'learnMoreLink',
type: 'linkItem',
validation: Rule => Rule.required(),
},
{
title: 'Logo',
name: 'logo',
type: 'customImage',
validation: Rule => Rule.required(),
},
],
};
18 changes: 18 additions & 0 deletions schemas/objects/linkItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export default {
type: 'object',
name: 'linkItem',
title: 'Link Item',
fields: [
{
title: 'Href',
name: 'href',
type: 'url',
},
{
title: 'Text',
name: 'text',
type: 'string',
validation: Rule => Rule.required(),
},
],
};
4 changes: 4 additions & 0 deletions schemas/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import tokenPage from './documents/www/tokenPage';
import walletAddressRegistrationPage from './documents/www/walletAddressRegistrationPage';
import nctPage from './documents/www/nctPage';
import creditCategory from './documents/shared/creditCategory';
import tebuBanner from './documents/terrasos/tebuBanner';

export const documentsSchemas = [
homePage,
Expand Down Expand Up @@ -129,6 +130,7 @@ export const documentsSchemas = [
walletAddressRegistrationPage,
nctPage,
creditCategory,
tebuBanner,
];

// Object types
Expand Down Expand Up @@ -268,6 +270,7 @@ import prefinanceTimelineItem from './objects/prefinanceTimelineItem';
import prefinanceProjects from './objects/prefinanceProjects';
import createProjectPagePopup from './objects/createProjectPagePopup';
import sellOrderPrice from './objects/sellOrderPrice';
import linkItem from './objects/linkItem';

export const objectSchemas = [
heroSection,
Expand Down Expand Up @@ -406,6 +409,7 @@ export const objectSchemas = [
prefinanceProjects,
createProjectPagePopup,
sellOrderPrice,
linkItem,
];

export default [
Expand Down

0 comments on commit 50c5981

Please sign in to comment.