Skip to content

Commit

Permalink
fix(Spin): 修复样式设置错误导致大小改变无效
Browse files Browse the repository at this point in the history
  • Loading branch information
shaodahong committed Jan 21, 2019
1 parent f8314af commit 2f8ba09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ body,
height: 60px;
margin: -30px 0 0 -30px;
}
.x-loading__spin_path {
.auto-ui-loading__spin_path {
stroke-width: 2px; /*no*/
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class Modal extends React.Component<ModalProps, ModalState> {
<div
className="x-modal__inner"
style={{
height: composeHeight ? composeHeight + '%' : 'auto'
height: composeHeight ? composeHeight + '%' : ''
}}
onAnimationEnd={this._onAnimationEnd}
>
Expand Down
17 changes: 13 additions & 4 deletions packages/spin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ export interface SpinProps {
const Spin: React.FC<SpinProps> = props => {
const { className, text, ...otherProps } = props

let innerClassName
let outClassName

if (text) {
innerClassName = cn('auto-ui-loading__spin')
outClassName = cn('auto-ui-spin', className)
} else {
innerClassName = cn('auto-ui-loading__spin', className)
outClassName = cn('auto-ui-spin')
}

const loadingSpin = (
<div className="auto-ui-loading__spin">
<div className={innerClassName}>
<svg className="auto-ui-loading__spin_circular" viewBox="25 25 50 50">
<circle
className="auto-ui-loading__spin_path"
Expand All @@ -27,10 +38,8 @@ const Spin: React.FC<SpinProps> = props => {
</div>
)

let composeClassName = cn('auto-ui-spin', className)

return (
<div {...otherProps} className={composeClassName}>
<div {...otherProps} className={outClassName}>
{loadingSpin}
{!!text && <p className="auto-ui-spin__text">{text}</p>}
</div>
Expand Down

0 comments on commit 2f8ba09

Please sign in to comment.