mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
Merge pull request #597 from toeverything/feature/fix-button-loading
feat: fix show content when loading
This commit is contained in:
@@ -43,14 +43,16 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
{loading ? (
|
||||
<Loading type={type}></Loading>
|
||||
) : (
|
||||
icon &&
|
||||
cloneElement(Children.only(icon), {
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
className: `affine-button-icon ${icon.props.className ?? ''}`,
|
||||
})
|
||||
<>
|
||||
{icon &&
|
||||
cloneElement(Children.only(icon), {
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
className: `affine-button-icon ${icon.props.className ?? ''}`,
|
||||
})}
|
||||
{children && <span>{children}</span>}
|
||||
</>
|
||||
)}
|
||||
{children && <span>{children}</span>}
|
||||
</StyledButton>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user