fix: add closable classname for fix text overlap

This commit is contained in:
愚道 2018-12-05 10:38:42 +08:00 committed by 偏右
parent 30bd445f89
commit 7716169daf
2 changed files with 10 additions and 5 deletions

View File

@ -106,18 +106,19 @@ export default class Alert extends React.Component<AlertProps, AlertState> {
}
}
// closeable when closeText is assigned
if (closeText) {
closable = true;
}
const alertCls = classNames(prefixCls, `${prefixCls}-${type}`, {
[`${prefixCls}-close`]: !this.state.closing,
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !showIcon,
[`${prefixCls}-banner`]: !!banner,
[`${prefixCls}-closable`]: closable,
}, className);
// closeable when closeText is assigned
if (closeText) {
closable = true;
}
const closeIcon = closable ? (
<a onClick={this.handleClose} className={`${prefixCls}-close-icon`}>
{closeText || <Icon type="close" />}

View File

@ -17,6 +17,10 @@
padding: 8px 15px;
}
&&-closable {
padding-right: 30px;
}
&-icon {
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;
left: 16px;