Skip to content

Commit

Permalink
feat: add profile/project banner card (#59)
Browse files Browse the repository at this point in the history
* feat: add profile/project banner card

* feat: add new schema files

* chore: make bannerCard optional on project and profile pages
  • Loading branch information
blushi authored May 22, 2024
1 parent 29a9387 commit 2a5e132
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deskStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default S =>
.title('Project Page')
.schemaType('projectPage')
.child(S.document().schemaType('projectPage')),
S.listItem()
.title('Profile Page')
.schemaType('profilePage')
.child(S.document().schemaType('profilePage')),
S.listItem()
.title('Bridge Page')
.schemaType('bridgePage')
Expand Down
14 changes: 14 additions & 0 deletions schemas/documents/registry/profilePage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default {
name: 'profilePage',
type: 'document',
title: 'Profile Page',
fields: [
{
title: 'Banner Card',
name: 'bannerCard',
type: 'bannerCard',
description:
'This card gets displayed the first time a user accesses his/her own profile page',
},
],
};
7 changes: 7 additions & 0 deletions schemas/documents/registry/projectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ export default {
type: 'document',
title: 'Project Page',
fields: [
{
title: 'Banner Card',
name: 'bannerCard',
type: 'bannerCard',
description:
'This card gets displayed to project admins the first time they access one of their project pages',
},
{
name: 'gettingStartedResourcesSection',
description: 'This content will appear on all project pages',
Expand Down
31 changes: 31 additions & 0 deletions schemas/objects/cards/bannerCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export default {
name: 'bannerCard',
type: 'object',
title: 'BannerCard',
fields: [
{
title: 'Title',
name: 'title',
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(),
},
{
title: 'Button label',
name: 'buttonLabel',
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 @@ -11,6 +11,7 @@ import creditClassPage from './documents/registry/creditClassPage';
import landStewardsPage from './documents/registry/landStewardsPage';
import buyersPage from './documents/www/buyersPage';
import mainnetPage from './documents/www/mainnetPage';
import profilePage from './documents/registry/profilePage';
import projectsPage from './documents/registry/projectsPage';
import projectPage from './documents/registry/projectPage';
import bridgePage from './documents/registry/bridgePage';
Expand Down Expand Up @@ -73,6 +74,7 @@ import bottomBanner from './objects/bottomBanner';
import card from './objects/cards/card';
import pageMetadata from './objects/pageMetadata';
import customPortableText from './objects/customPortableText';
import bannerCard from './objects/cards/bannerCard';
import button from './objects/button';
import customImage from './objects/customImage';
import link from './objects/link';
Expand Down Expand Up @@ -200,6 +202,7 @@ import creditCategory from './documents/shared/creditCategory';

export default [
actionCard,
bannerCard,
basicStepCardSection,
basketDetailsPage,
blogPost,
Expand Down Expand Up @@ -344,6 +347,7 @@ export default [
projectPrefinanceTimelineStatus,
detailsSection,
detailsCard,
profilePage,
projectPage,
projectRating,
projectsPage,
Expand Down

0 comments on commit 2a5e132

Please sign in to comment.