Skip to content

Commit

Permalink
Plug into cards
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Sep 26, 2022
1 parent 3dd7bbe commit d6a226f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/blocks/Listing/templates/CardsCarousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,18 @@ CardsCarousel.schemaEnhancer = (args) => {
};
};

CardsCarousel.styleSchemaEnhancer = ({ schema, intl }) => {
const styleSchema = schema.properties.styles.schema;
styleSchema.fieldsets[0].fields.push('oblique');
styleSchema.properties = {
...styleSchema.properties,
oblique: {
title: 'Oblique',
type: 'boolean',
},
};

return schema;
};

export default CardsCarousel;
18 changes: 16 additions & 2 deletions src/components/UniversalCard/schema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { defineMessages } from 'react-intl';
import { schemaEnhancerFactory } from '@eeacms/volto-listing-block/schema-utils';
import {
schemaEnhancerFactory,
enhanceStylingSchema,
} from '@eeacms/volto-listing-block/schema-utils';

const messages = defineMessages({
title: {
Expand Down Expand Up @@ -113,8 +116,10 @@ export default function universalCardSchemaEnhancer(props) {
const enhancer = schemaEnhancerFactory({
extensionName: 'cardTemplates',
messages,
blockType: 'listing',
extensionField: '@type',
});
return {
const baseSchema = {
...schema,
fieldsets: [
...schema.fieldsets,
Expand All @@ -136,4 +141,13 @@ export default function universalCardSchemaEnhancer(props) {
},
},
};

const styledSchema = enhanceStylingSchema({
...props,
schema: baseSchema,
// schema: baseSchema.properties.styles.schema,
formData: props.formData,
});

return styledSchema;
}

0 comments on commit d6a226f

Please sign in to comment.