Skip to content

Commit

Permalink
feat: add featured projects to registry home (#49)
Browse files Browse the repository at this point in the history
* feat: add featured projects to registry home

* feat: remove image and location from project mandatory fields
  • Loading branch information
flagrede authored Oct 31, 2023
1 parent 9e4e1a5 commit cd79eb3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion schemas/documents/registry/homePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
},
{
name: 'projectsSection',
type: 'titleCustomBody',
type: 'homePageProjectsSection',
title: 'Projects Section',
validation: Rule => Rule.required(),
},
Expand Down
6 changes: 2 additions & 4 deletions schemas/documents/shared/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ export default {
validation: Rule => Rule.required(),
},
{
title: 'Project id',
title: 'Project id, uuid or slug',
name: 'projectId',
type: 'string',
description: 'on-chain project id',
description: 'on-chain project id, off-chain uuid or slug',
validation: Rule => Rule.required(),
},
{
title: 'Project Image',
name: 'image',
type: 'customImage',
validation: Rule => Rule.required(),
},
{
title: 'Project Location',
name: 'location',
type: 'string',
validation: Rule => Rule.required(),
},
{
title: 'Area',
Expand Down
24 changes: 24 additions & 0 deletions schemas/objects/sections/homePage/homePageProjectsSection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export default {
type: 'object',
name: 'homePageProjectsSection',
title: 'Home Page Projects Section',
fields: [
{
name: 'titleCustomBody',
type: 'titleCustomBody',
title: 'Title and Body',
validation: Rule => Rule.required(),
},
{
title: 'Featured Projects',
name: 'projects',
type: 'array',
of: [
{
type: 'reference',
to: [{ type: 'project' }],
},
],
},
],
};
2 changes: 2 additions & 0 deletions schemas/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ 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';
import homePageProjectsSection from './objects/sections/homePage/homePageProjectsSection';

export default [
actionCard,
Expand Down Expand Up @@ -273,6 +274,7 @@ export default [
homeFoldSection,
homePage,
homePageTopSection,
homePageProjectsSection,
homePageWeb,
homeValuesSection,
homeWebEcologicalCreditCardsSection,
Expand Down

0 comments on commit cd79eb3

Please sign in to comment.