Skip to content

Commit

Permalink
fix: #1461
Browse files Browse the repository at this point in the history
  • Loading branch information
solarjoker committed Dec 23, 2020
1 parent 728eeda commit 10b51bf
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions components/loading/Loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ class Loading extends Component {
</div>
</div>
) : (
<div className={`${prefixCls}__outter`}>
<div className={iconCls}>
<div />
<div />
visible !== false && (
<div className={`${prefixCls}__outter`}>
<div className={iconCls}>
<div />
<div />
</div>
<div className={`${prefixCls}__text`}>{content}</div>
</div>
<div className={`${prefixCls}__text`}>{content}</div>
</div>
)
)}
</PortalWrapper>
)
Expand All @@ -57,9 +59,13 @@ Loading.defaultProps = {
}

function PortalWrapper({ mountNode, children, visible }) {
return mountNode
? ReactDOM.createPortal(children, mountNode)
: visible !== false && <div className={`${prefixCls}__wrapper`}>{children}</div>
return mountNode ? (
ReactDOM.createPortal(children, mountNode)
) : visible ? (
<div className={`${prefixCls}__wrapper`}>{children}</div>
) : (
children
)
}

function open(target, { content, key, duration, size } = {}) {
Expand Down

0 comments on commit 10b51bf

Please sign in to comment.