Skip to content

Commit

Permalink
Fix button style wrapper and props passed
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Oct 17, 2024
1 parent 00f7b61 commit 7551dde
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/volto-button-block/src/components/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ const messages = defineMessages({
});

const LegacyWrapper = (props) => (
<div className={cx('block __button', props.className)}>
<div className={cx('block __button', props.className)} style={props.style}>
<div className="button container">
<div className={cx(`align ${props.data?.inneralign}`)}>
<div className={cx('align', props.data?.inneralign)}>
{props.children}
</div>
</div>
</div>
);

const View = ({ data, isEditMode, className, blocksConfig }) => {
const View = (props) => {
const { data, isEditMode, blocksConfig } = props;
const [hasLink, setHasLink] = React.useState(false);
const intl = useIntl();
const isBlockModelv3 = blocksConfig?.__button?.blockModel === 3;
Expand Down Expand Up @@ -58,7 +59,7 @@ const View = ({ data, isEditMode, className, blocksConfig }) => {
);

return (
<MaybeWrap condition={!isBlockModelv3} as={LegacyWrapper}>
<MaybeWrap {...props} condition={!isBlockModelv3} as={LegacyWrapper}>
{link}
</MaybeWrap>
);
Expand Down

0 comments on commit 7551dde

Please sign in to comment.