Skip to content

Commit

Permalink
add legacy wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
danalvrz committed Nov 5, 2024
1 parent 8cd054e commit cfd676d
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import cx from 'classnames';
import { TextBlockView } from '@plone/volto-slate/blocks/Text';
import { MaybeWrap } from '@plone/volto/components';

const LegacyWrapper = (props) => (
<div
className={cx('block', 'introduction', props.className)}
style={props.style}
>
<div className="block-container">{props.children}</div>
</div>
);

const IntroductionBlockView = (props) => {
const { className } = props;
const { blocksConfig } = props;
const isBlockModelv3 = blocksConfig?.introduction?.blockModel === 3;

return (
<div className={cx('block', 'introduction', className)}>
<div className="block-container">
<TextBlockView {...props} />
</div>
</div>
<MaybeWrap {...props} condition={!isBlockModelv3} as={LegacyWrapper}>
<TextBlockView {...props} />
</MaybeWrap>
);
};

Expand Down

0 comments on commit cfd676d

Please sign in to comment.