mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 04:30:06 +08:00
should only affect notification without description and with icon, #5846
This commit is contained in:
parent
12a9f1e5b5
commit
455a23f1bb
@ -3,7 +3,7 @@ import Notification from 'rc-notification';
|
||||
import Icon from '../icon';
|
||||
import assign from 'object-assign';
|
||||
let notificationInstance;
|
||||
let defaultDuration = 4.5;
|
||||
let defaultDuration = 0;
|
||||
let defaultTop = 24;
|
||||
let defaultBottom = 24;
|
||||
let defaultPlacement = 'topRight';
|
||||
@ -120,12 +120,16 @@ function notice(args) {
|
||||
iconNode = <Icon className={`${prefixCls}-icon ${prefixCls}-icon-${args.type}`} type={iconType} />;
|
||||
}
|
||||
|
||||
const autoMarginTag = (!args.description && iconNode)
|
||||
? <span className={`${prefixCls}-message-single-line-auto-margin`} />
|
||||
: null;
|
||||
|
||||
getNotificationInstance(outerPrefixCls).notice({
|
||||
content: (
|
||||
<div className={iconNode ? `${prefixCls}-with-icon` : ''}>
|
||||
{iconNode}
|
||||
<div className={`${prefixCls}-message`}>
|
||||
<span className={`${prefixCls}-message-single-line-auto-margin`} />
|
||||
{autoMarginTag}
|
||||
{args.message}
|
||||
</div>
|
||||
<div className={`${prefixCls}-description`}>{args.description}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user