Skip to content

Commit

Permalink
Merge pull request #15 from kleros/feat(cms)/add-home-hero
Browse files Browse the repository at this point in the history
feat(cms): add home page hero
  • Loading branch information
alcercu authored Oct 31, 2024
2 parents 9b657ee + 9b14274 commit 72a546f
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"kind": "singleType",
"collectionName": "home_page_heroes",
"info": {
"singularName": "home-page-hero",
"pluralName": "home-page-heroes",
"displayName": "HomePageHero",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"primaryButton": {
"type": "component",
"repeatable": false,
"component": "content.button-link"
},
"secondaryButton": {
"type": "component",
"repeatable": false,
"component": "content.button-link"
},
"arrowLink": {
"type": "component",
"repeatable": false,
"component": "content.button-link"
},
"background": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* home-page-hero controller
*/

import { factories } from '@strapi/strapi'

export default factories.createCoreController('api::home-page-hero.home-page-hero');
7 changes: 7 additions & 0 deletions cms-backend/src/api/home-page-hero/routes/home-page-hero.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* home-page-hero router
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreRouter('api::home-page-hero.home-page-hero');
7 changes: 7 additions & 0 deletions cms-backend/src/api/home-page-hero/services/home-page-hero.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* home-page-hero service
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreService('api::home-page-hero.home-page-hero');
17 changes: 17 additions & 0 deletions cms-backend/src/components/content/button-link.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"collectionName": "components_content_button_links",
"info": {
"displayName": "ButtonLink"
},
"options": {},
"attributes": {
"text": {
"type": "string"
},
"link": {
"type": "relation",
"relation": "oneToOne",
"target": "api::link.link"
}
}
}
12 changes: 12 additions & 0 deletions cms-backend/types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,23 @@ export interface ContentNavlink extends Struct.ComponentSchema {
};
}

export interface ContentButtonLink extends Struct.ComponentSchema {
collectionName: 'components_content_button_links';
info: {
displayName: 'ButtonLink';
};
attributes: {
text: Schema.Attribute.String;
link: Schema.Attribute.Relation<'oneToOne', 'api::link.link'>;
};
}

declare module '@strapi/strapi' {
export module Public {
export interface ComponentSchemas {
'content.section': ContentSection;
'content.navlink': ContentNavlink;
'content.button-link': ContentButtonLink;
}
}
}
36 changes: 36 additions & 0 deletions cms-backend/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,41 @@ export interface ApiFooterSubscribeCtaFooterSubscribeCta
};
}

export interface ApiHomePageHeroHomePageHero extends Struct.SingleTypeSchema {
collectionName: 'home_page_heroes';
info: {
singularName: 'home-page-hero';
pluralName: 'home-page-heroes';
displayName: 'HomePageHero';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
title: Schema.Attribute.String;
subtitle: Schema.Attribute.String;
primaryButton: Schema.Attribute.Component<'content.button-link', false>;
secondaryButton: Schema.Attribute.Component<'content.button-link', false>;
arrowLink: Schema.Attribute.Component<'content.button-link', false>;
background: Schema.Attribute.Media<
'images' | 'files' | 'videos' | 'audios'
>;
createdAt: Schema.Attribute.DateTime;
updatedAt: Schema.Attribute.DateTime;
publishedAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
locale: Schema.Attribute.String;
localizations: Schema.Attribute.Relation<
'oneToMany',
'api::home-page-hero.home-page-hero'
>;
};
}

export interface ApiKlerosLogoKlerosLogo extends Struct.SingleTypeSchema {
collectionName: 'kleros_logo';
info: {
Expand Down Expand Up @@ -1183,6 +1218,7 @@ declare module '@strapi/strapi' {
'api::footer-links-section.footer-links-section': ApiFooterLinksSectionFooterLinksSection;
'api::footer-socials-section.footer-socials-section': ApiFooterSocialsSectionFooterSocialsSection;
'api::footer-subscribe-cta.footer-subscribe-cta': ApiFooterSubscribeCtaFooterSubscribeCta;
'api::home-page-hero.home-page-hero': ApiHomePageHeroHomePageHero;
'api::kleros-logo.kleros-logo': ApiKlerosLogoKlerosLogo;
'api::link.link': ApiLinkLink;
'api::navbar-button.navbar-button': ApiNavbarButtonNavbarButton;
Expand Down

0 comments on commit 72a546f

Please sign in to comment.