Skip to content

Commit 72a546f

Browse files
authored
Merge pull request #15 from kleros/feat(cms)/add-home-hero
feat(cms): add home page hero
2 parents 9b657ee + 9b14274 commit 72a546f

File tree

7 files changed

+133
-0
lines changed

7 files changed

+133
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"kind": "singleType",
3+
"collectionName": "home_page_heroes",
4+
"info": {
5+
"singularName": "home-page-hero",
6+
"pluralName": "home-page-heroes",
7+
"displayName": "HomePageHero",
8+
"description": ""
9+
},
10+
"options": {
11+
"draftAndPublish": true
12+
},
13+
"pluginOptions": {},
14+
"attributes": {
15+
"title": {
16+
"type": "string"
17+
},
18+
"subtitle": {
19+
"type": "string"
20+
},
21+
"primaryButton": {
22+
"type": "component",
23+
"repeatable": false,
24+
"component": "content.button-link"
25+
},
26+
"secondaryButton": {
27+
"type": "component",
28+
"repeatable": false,
29+
"component": "content.button-link"
30+
},
31+
"arrowLink": {
32+
"type": "component",
33+
"repeatable": false,
34+
"component": "content.button-link"
35+
},
36+
"background": {
37+
"allowedTypes": [
38+
"images",
39+
"files",
40+
"videos",
41+
"audios"
42+
],
43+
"type": "media",
44+
"multiple": false
45+
}
46+
}
47+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* home-page-hero controller
3+
*/
4+
5+
import { factories } from '@strapi/strapi'
6+
7+
export default factories.createCoreController('api::home-page-hero.home-page-hero');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* home-page-hero router
3+
*/
4+
5+
import { factories } from '@strapi/strapi';
6+
7+
export default factories.createCoreRouter('api::home-page-hero.home-page-hero');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* home-page-hero service
3+
*/
4+
5+
import { factories } from '@strapi/strapi';
6+
7+
export default factories.createCoreService('api::home-page-hero.home-page-hero');
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"collectionName": "components_content_button_links",
3+
"info": {
4+
"displayName": "ButtonLink"
5+
},
6+
"options": {},
7+
"attributes": {
8+
"text": {
9+
"type": "string"
10+
},
11+
"link": {
12+
"type": "relation",
13+
"relation": "oneToOne",
14+
"target": "api::link.link"
15+
}
16+
}
17+
}

cms-backend/types/generated/components.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,23 @@ export interface ContentNavlink extends Struct.ComponentSchema {
2727
};
2828
}
2929

30+
export interface ContentButtonLink extends Struct.ComponentSchema {
31+
collectionName: 'components_content_button_links';
32+
info: {
33+
displayName: 'ButtonLink';
34+
};
35+
attributes: {
36+
text: Schema.Attribute.String;
37+
link: Schema.Attribute.Relation<'oneToOne', 'api::link.link'>;
38+
};
39+
}
40+
3041
declare module '@strapi/strapi' {
3142
export module Public {
3243
export interface ComponentSchemas {
3344
'content.section': ContentSection;
3445
'content.navlink': ContentNavlink;
46+
'content.button-link': ContentButtonLink;
3547
}
3648
}
3749
}

cms-backend/types/generated/contentTypes.d.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,41 @@ export interface ApiFooterSubscribeCtaFooterSubscribeCta
572572
};
573573
}
574574

575+
export interface ApiHomePageHeroHomePageHero extends Struct.SingleTypeSchema {
576+
collectionName: 'home_page_heroes';
577+
info: {
578+
singularName: 'home-page-hero';
579+
pluralName: 'home-page-heroes';
580+
displayName: 'HomePageHero';
581+
description: '';
582+
};
583+
options: {
584+
draftAndPublish: true;
585+
};
586+
attributes: {
587+
title: Schema.Attribute.String;
588+
subtitle: Schema.Attribute.String;
589+
primaryButton: Schema.Attribute.Component<'content.button-link', false>;
590+
secondaryButton: Schema.Attribute.Component<'content.button-link', false>;
591+
arrowLink: Schema.Attribute.Component<'content.button-link', false>;
592+
background: Schema.Attribute.Media<
593+
'images' | 'files' | 'videos' | 'audios'
594+
>;
595+
createdAt: Schema.Attribute.DateTime;
596+
updatedAt: Schema.Attribute.DateTime;
597+
publishedAt: Schema.Attribute.DateTime;
598+
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
599+
Schema.Attribute.Private;
600+
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
601+
Schema.Attribute.Private;
602+
locale: Schema.Attribute.String;
603+
localizations: Schema.Attribute.Relation<
604+
'oneToMany',
605+
'api::home-page-hero.home-page-hero'
606+
>;
607+
};
608+
}
609+
575610
export interface ApiKlerosLogoKlerosLogo extends Struct.SingleTypeSchema {
576611
collectionName: 'kleros_logo';
577612
info: {
@@ -1183,6 +1218,7 @@ declare module '@strapi/strapi' {
11831218
'api::footer-links-section.footer-links-section': ApiFooterLinksSectionFooterLinksSection;
11841219
'api::footer-socials-section.footer-socials-section': ApiFooterSocialsSectionFooterSocialsSection;
11851220
'api::footer-subscribe-cta.footer-subscribe-cta': ApiFooterSubscribeCtaFooterSubscribeCta;
1221+
'api::home-page-hero.home-page-hero': ApiHomePageHeroHomePageHero;
11861222
'api::kleros-logo.kleros-logo': ApiKlerosLogoKlerosLogo;
11871223
'api::link.link': ApiLinkLink;
11881224
'api::navbar-button.navbar-button': ApiNavbarButtonNavbarButton;

0 commit comments

Comments
 (0)