Skip to content

Commit

Permalink
feat: #1466
Browse files Browse the repository at this point in the history
  • Loading branch information
solarjoker committed Dec 23, 2020
1 parent 7b0d975 commit 0404914
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 20 additions & 2 deletions components/card/NormalCard.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import React from 'react'
import classNames from 'classnames'
import Loading from '../loading'

const NormalCard = ({ children, size, title, extra, showHeaderDivider, style, className, hoverable, bordered }) => {
const NormalCard = ({
children,
size,
title,
extra,
showHeaderDivider,
style,
className,
hoverable,
bordered,
loading
}) => {
return (
<div
className={classNames('hi-card', className, showHeaderDivider ? 'hi-card--standard' : 'hi-card--normal', {
Expand All @@ -17,7 +29,13 @@ const NormalCard = ({ children, size, title, extra, showHeaderDivider, style, cl
{extra}
</div>
)}
<div className="hi-card__content">{children}</div>
{loading !== undefined ? (
<Loading visible={loading}>
<div className="hi-card__content">{children}</div>
</Loading>
) : (
<div className="hi-card__content">{children}</div>
)}
</div>
)
}
Expand Down
4 changes: 3 additions & 1 deletion components/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const Card = ({
children,
showHeaderDivider,
type,
bordered = true
bordered = true,
loading
}) => {
if (cover || coverUrl) {
return (
Expand Down Expand Up @@ -52,6 +53,7 @@ const Card = ({
showHeaderDivider={showHeaderDivider}
hoverable={hoverable}
bordered={bordered}
loading={loading}
>
{children}
</NormalCard>
Expand Down

0 comments on commit 0404914

Please sign in to comment.