Skip to content

Commit

Permalink
feat: ajout de nouveaux blocs
Browse files Browse the repository at this point in the history
  • Loading branch information
PassCulture committed Jul 11, 2024
1 parent 1792df2 commit c60868e
Show file tree
Hide file tree
Showing 26 changed files with 435 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
"block.header-with-q-rcode",
"block.columns-text",
"block.centered-title",
"block.tabs"
"block.tabs-simple-text",
"block.tabs-push-grey-cta",
"block.tabs-little-list",
"block.tabs-image-text"
]
},
"seo": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@
"description": ""
},
"options": {},
"attributes": {
"isUnderHeader": {
"type": "boolean",
"default": false
}
}
"attributes": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"type": "media",
"multiple": false,
"required": true,
"allowedTypes": ["images"]
"allowedTypes": [
"images"
]
},
"isImageRight": {
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"collectionName": "components_block_tab",
"collectionName": "components_block_tab_image_texts",
"info": {
"displayName": "tab"
"displayName": "TabImageText"
},
"options": {},
"attributes": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"collectionName": "components_block_tab_little_lists",
"info": {
"displayName": "TabLittleList"
},
"options": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"block": {
"type": "component",
"repeatable": false,
"component": "block.little-list"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"collectionName": "components_block_tab_push_grey_ctas",
"info": {
"displayName": "TabPushGreyCTA"
},
"options": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"block": {
"type": "component",
"repeatable": false,
"component": "block.double-push-cta"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"collectionName": "components_block_tab_simple_texts",
"info": {
"displayName": "TabSimpleText"
},
"options": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"block": {
"type": "component",
"repeatable": false,
"component": "block.simple-text-v2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"collectionName": "components_block_tabs_image_texts",
"info": {
"displayName": "TabsImageText"
},
"options": {},
"attributes": {
"tab": {
"displayName": "TabLittleList",
"type": "component",
"repeatable": true,
"component": "block.tab-image-text"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"collectionName": "components_block_tabs_little_lists",
"info": {
"displayName": "TabsLittleList"
},
"options": {},
"attributes": {
"tab": {
"displayName": "TabLittleList",
"type": "component",
"repeatable": true,
"component": "block.tab-little-list"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"collectionName": "components_block_tabs_push_grey_ctas",
"info": {
"displayName": "TabsPushGreyCTA",
"description": ""
},
"options": {},
"attributes": {
"tab": {
"displayName": "TabPushGreyCTA",
"type": "component",
"repeatable": true,
"component": "block.tab-push-grey-cta"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"collectionName": "components_block_tabs_simple_texts",
"info": {
"displayName": "TabsSimpleText"
},
"options": {},
"attributes": {
"tab": {
"displayName": "TabSimpleText",
"type": "component",
"repeatable": true,
"component": "block.tab-simple-text"
}
}
}
16 changes: 0 additions & 16 deletions content_management_system/src/components/block/tabs.json

This file was deleted.

91 changes: 79 additions & 12 deletions content_management_system/types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export interface BlockBreadcrumb extends Schema.Component {
displayName: 'Breadcrumbs';
description: '';
};
attributes: {
isUnderHeader: Attribute.Boolean & Attribute.DefaultTo<false>;
};
attributes: {};
}

export interface BlockCenteredText extends Schema.Component {
Expand Down Expand Up @@ -426,25 +424,88 @@ export interface BlockSpace extends Schema.Component {
};
}

export interface BlockTab extends Schema.Component {
collectionName: 'components_block_tab';
export interface BlockTabImageText extends Schema.Component {
collectionName: 'components_block_tab_image_texts';
info: {
displayName: 'tab';
displayName: 'TabImageText';
};
attributes: {
title: Attribute.String & Attribute.Required;
block: Attribute.Component<'block.image-text'>;
};
}

export interface BlockTabs extends Schema.Component {
collectionName: 'components_block_tabs';
export interface BlockTabLittleList extends Schema.Component {
collectionName: 'components_block_tab_little_lists';
info: {
displayName: 'TabLittleList';
};
attributes: {
title: Attribute.String & Attribute.Required;
block: Attribute.Component<'block.little-list'>;
};
}

export interface BlockTabPushGreyCta extends Schema.Component {
collectionName: 'components_block_tab_push_grey_ctas';
info: {
displayName: 'TabPushGreyCTA';
};
attributes: {
title: Attribute.String & Attribute.Required;
block: Attribute.Component<'block.double-push-cta'>;
};
}

export interface BlockTabSimpleText extends Schema.Component {
collectionName: 'components_block_tab_simple_texts';
info: {
displayName: 'TabSimpleText';
};
attributes: {
title: Attribute.String & Attribute.Required;
block: Attribute.Component<'block.simple-text-v2'>;
};
}

export interface BlockTabsImageText extends Schema.Component {
collectionName: 'components_block_tabs_image_texts';
info: {
displayName: 'Tabs';
displayName: 'TabsImageText';
};
attributes: {
tab: Attribute.Component<'block.tab-image-text', true>;
};
}

export interface BlockTabsLittleList extends Schema.Component {
collectionName: 'components_block_tabs_little_lists';
info: {
displayName: 'TabsLittleList';
};
attributes: {
tab: Attribute.Component<'block.tab-little-list', true>;
};
}

export interface BlockTabsPushGreyCta extends Schema.Component {
collectionName: 'components_block_tabs_push_grey_ctas';
info: {
displayName: 'TabsPushGreyCTA';
description: '';
};
attributes: {
tab: Attribute.Component<'block.tab', true>;
tab: Attribute.Component<'block.tab-push-grey-cta', true>;
};
}

export interface BlockTabsSimpleText extends Schema.Component {
collectionName: 'components_block_tabs_simple_texts';
info: {
displayName: 'TabsSimpleText';
};
attributes: {
tab: Attribute.Component<'block.tab-simple-text', true>;
};
}

Expand Down Expand Up @@ -1143,8 +1204,14 @@ declare module '@strapi/types' {
'block.simple-text-v2': BlockSimpleTextV2;
'block.social-media': BlockSocialMedia;
'block.space': BlockSpace;
'block.tab': BlockTab;
'block.tabs': BlockTabs;
'block.tab-image-text': BlockTabImageText;
'block.tab-little-list': BlockTabLittleList;
'block.tab-push-grey-cta': BlockTabPushGreyCta;
'block.tab-simple-text': BlockTabSimpleText;
'block.tabs-image-text': BlockTabsImageText;
'block.tabs-little-list': BlockTabsLittleList;
'block.tabs-push-grey-cta': BlockTabsPushGreyCta;
'block.tabs-simple-text': BlockTabsSimpleText;
'block.vertical-carousel': BlockVerticalCarousel;
'block.video': BlockVideo;
'common.detailed-logo': CommonDetailedLogo;
Expand Down
5 changes: 4 additions & 1 deletion content_management_system/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,10 @@ export interface ApiPagePage extends Schema.CollectionType {
'block.header-with-q-rcode',
'block.columns-text',
'block.centered-title',
'block.tabs'
'block.tabs-simple-text',
'block.tabs-push-grey-cta',
'block.tabs-little-list',
'block.tabs-image-text'
]
>;
seo: Attribute.Component<'shared.seo'>;
Expand Down
10 changes: 8 additions & 2 deletions public_website/src/lib/BlockRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ import { SimplePushCta } from './blocks/SimplePushCta'
import { SimpleTextV2 } from './blocks/SimpleTextV2'
import { SimpleTextWithMedia } from './blocks/SimpleTextWithMedia'
import { SocialMedia } from './blocks/SocialMedia'
import TabSimpleText from './blocks/tabs/TabSimpleText'
import TabsImageText from './blocks/tabs/TabsImageText'
import TabsPushGreyCta from './blocks/tabs/TabsPushGreyCta'
import TabsLittleList from './blocks/tabs/TabsSimpleList'
import TabsSimpleText from './blocks/tabs/TabsSimpleText'
import { VerticalCarousel } from './blocks/verticalCarousel/VerticalCarousel'
import { Video } from './blocks/Video'
import { WhiteSpace } from './blocks/WhiteSpace'
Expand Down Expand Up @@ -80,7 +83,10 @@ const COMPONENTS: Record<
'block.header-with-q-rcode': HeaderWithQRCode,
'block.columns-text': SimpleTextWithMedia,
'block.centered-title': CenteredText,
'block.tabs': TabSimpleText,
'block.tabs-image-text': TabsImageText,
'block.tabs-simple-text': TabsSimpleText,
'block.tabs-little-list': TabsLittleList,
'block.tabs-push-grey-cta': TabsPushGreyCta,
}

export function BlockRenderer(props: BlockRendererProps) {
Expand Down
4 changes: 2 additions & 2 deletions public_website/src/lib/blocks/DoublePushCta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { parseText } from '@/utils/parseText'

export function DoublePushCTA(
props: PushCTAProps & {
text: string | undefined
text?: string
firstCta: CTA
secondCta: CTA | undefined
secondCta?: CTA
}
) {
const {
Expand Down
Loading

0 comments on commit c60868e

Please sign in to comment.