Merge pull request #1161 from lowdefy/fix-confirm-modal-v4

fix(blocks-antd): Fix confirm modal button icons, closes #1160
This commit is contained in:
Sam 2022-04-19 10:29:13 +02:00 committed by GitHub
commit 77d189196d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 4 deletions

View File

@ -70,7 +70,7 @@ const button = (path) => ({
},
properties: {
size: 'small',
title: 'button:',
title: `${path}:`,
inner: true,
},
blocks: [

View File

@ -108,7 +108,7 @@ test('button propertiesFormTransformer', () => {
"properties": Object {
"inner": true,
"size": "small",
"title": "button:",
"title": "block.properties.field:",
},
"type": "Card",
},

View File

@ -38,8 +38,32 @@ const ConfirmModal = ({ blockId, events, content, components: { Icon }, methods,
className: methods.makeCssClass(properties.modalStyle),
closable: properties.closable,
okText: properties.okText || 'Ok',
okButtonProps: properties.okButton,
cancelButtonProps: properties.cancelButton,
okButtonProps:
properties.okButton && properties.okButton.icon
? {
...properties.okButton,
icon: properties.okButton.icon && (
<Icon
blockId={`${blockId}_ok_icon`}
events={events}
properties={properties.okButton.icon}
/>
),
}
: properties.okButton,
cancelButtonProps:
properties.cancelButton && properties.cancelButton.icon
? {
...properties.cancelButton,
icon: properties.cancelButton.icon && (
<Icon
blockId={`${blockId}_ok_icon`}
events={events}
properties={properties.cancelButton.icon}
/>
),
}
: properties.cancelButton,
cancelText: properties.cancelText || 'Cancel',
centered: properties.centered || false,
mask: properties.mask !== undefined ? properties.mask : true,