Commit 0f709cff by Andrej Ocenas Committed by GitHub

Fix when only icon is present (#20208)

parent 89c553cf
......@@ -18,13 +18,22 @@ type Props = {
export function ButtonContent(props: Props) {
const { icon, className, iconClassName, children } = props;
const styles = getStyles();
return icon ? (
<span className={cx(styles.content, className)}>
<i className={cx([icon, iconClassName])} />
&nbsp; &nbsp;
<span>{children}</span>
</span>
) : (
<span className={styles.content}>{children}</span>
);
if (icon && children) {
return (
<span className={cx(styles.content, className)}>
<i className={cx([icon, iconClassName])} />
&nbsp; &nbsp;
<span>{children}</span>
</span>
);
}
if (icon) {
return (
<span className={cx(styles.content, className)}>
<i className={cx([icon, iconClassName])} />
</span>
);
}
return <span className={styles.content}>{children}</span>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment