Skip to content

Commit

Permalink
change(teaser): added card styling to teaser
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Sep 27, 2022
1 parent 154020f commit c30aebd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/blocks/Teaser/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { defineMessages, useIntl } from 'react-intl';
import UniversalCard from '@eeacms/volto-listing-block/components/UniversalCard/UniversalCard';

import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg';
import { CardStylingSchemaEnhancer } from '../Listing/schema';

const messages = defineMessages({
PleaseChooseContent: {
Expand Down Expand Up @@ -44,6 +45,16 @@ TeaserCardTemplate.propTypes = {
isEditMode: PropTypes.bool,
};

TeaserCardTemplate.styleSchemaEnhancer = (schema) => {
console.log('teaser schema', schema);
return CardStylingSchemaEnhancer({ schema });
};

// TeaserCardTemplate.styleSchemaEnhancer = ({ schema }) => {
// console.log('teaser schema', schema);
// return CardStylingSchemaEnhancer({ schema });
// };

export default TeaserCardTemplate;

// const CardImage = (props) => {
Expand Down
5 changes: 3 additions & 2 deletions src/blocks/Teaser/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compose } from 'redux';
import TeaserCardTemplate from './Card';
import { CardStylingSchemaEnhancer } from '../Listing/schema';
import { BasicListingBlockStylesSchema } from '../Listing/schema';
import { adjustTeaserSchema } from './schema';
import UniversalCard from '@eeacms/volto-listing-block/components/UniversalCard/UniversalCard';

Expand All @@ -16,12 +16,13 @@ export default (config) => {
template: TeaserCardTemplate,
schemaEnhancer: compose(
adjustTeaserSchema,
TeaserCardTemplate.styleSchemaEnhancer,
UniversalCard.schemaEnhancer,
),
},
];
config.blocks.blocksConfig.teaser.enableStyling = true;
config.blocks.blocksConfig.teaser.stylesSchema = CardStylingSchemaEnhancer;
config.blocks.blocksConfig.teaser.stylesSchema = BasicListingBlockStylesSchema;
}

// Teaser Grid
Expand Down

0 comments on commit c30aebd

Please sign in to comment.