style: center icon when action buttons use icon-only (#5413)

This commit is contained in:
Katherine 2024-10-14 17:47:33 +08:00 committed by GitHub
parent 45f7a9bc7c
commit 227b9c59a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -47,6 +47,13 @@ const useStyles = genStyleHook('nb-action', (token) => {
},
},
},
'.ant-btn-icon': {
marginInlineEnd: '0px !important',
},
'.nb-action-title': {
marginInlineStart: '8px',
},
},
};
});

View File

@ -377,7 +377,6 @@ function RenderButton({
if (!designable && (field?.data?.hidden || !aclCtx)) {
return null;
}
return (
<SortableItem
role="button"
@ -393,7 +392,7 @@ function RenderButton({
className={classnames(componentCls, hashId, className, 'nb-action')}
type={type === 'danger' ? undefined : type}
>
{actionTitle}
{actionTitle && <span className={icon ? 'nb-action-title' : null}>{actionTitle}</span>}
<Designer {...designerProps} />
</SortableItem>
);