@capillarytech/creatives-library 2.0.36 → 2.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  import PropTypes from 'prop-types';
8
8
 
9
9
  import React from 'react';
10
- import { Row, Col } from 'antd';
10
+ import {CapSpin, CapRow, CapColumn} from '@capillarytech/cap-ui-library';
11
11
  import CustomCard from '../Card';
12
12
 
13
13
  class CardGrid extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -37,15 +37,18 @@ class CardGrid extends React.Component { // eslint-disable-line react/prefer-sta
37
37
  return (
38
38
  <div className={this.props.className}>
39
39
  <div style={{ marginBottom: '16px' }}>{this.props.filterContent}</div>
40
- <div className={this.props.enablePagination ? 'pagination-container' : ''}>
41
- <Row gutter={this.props.gutterSize}>
42
- { this.props.listItem.length > 0 ? this.props.listItem.map( (item) => (
43
- <Col style={{ width: `${100 / this.props.colNumber}%`, paddingBottom: '16px'}} key={item.id} span={parseInt(24 / this.props.colNumber, 10)}>
44
- <CustomCard id={item.id} onHover={this.handleOnItemHover} onClick={this.handleOnItemClick} content={item.content} footer={item.footer} height={item.footer ? "312px" : "258px"}></CustomCard>
45
- </Col>
46
- )) : ''}
47
- </Row>
48
- </div>
40
+ <CapSpin spinning={this.props.isLoading} tip={this.props.loadingTip}>
41
+ <div className={this.props.enablePagination ? 'pagination-container' : ''}>
42
+ <CapRow gutter={this.props.gutterSize}>
43
+ { this.props.listItem.length > 0 ? this.props.listItem.map( (item) => (
44
+ <CapColumn style={{ width: `${100 / this.props.colNumber}%`, paddingBottom: '16px'}} key={item.id} span={parseInt(24 / this.props.colNumber, 10)}>
45
+ <CustomCard id={item.id} onHover={this.handleOnItemHover} onClick={this.handleOnItemClick} content={item.content} footer={item.footer} height={item.footer ? "312px" : "258px"}></CustomCard>
46
+ </CapColumn>
47
+ )) : ''}
48
+ </CapRow>
49
+ </div>
50
+ </CapSpin>
51
+
49
52
  </div>
50
53
  );
51
54
  }
@@ -60,6 +63,8 @@ CardGrid.propTypes = {
60
63
  onItemClick: PropTypes.func,
61
64
  className: PropTypes.string,
62
65
  enablePagination: PropTypes.bool,
66
+ isLoading: PropTypes.bool,
67
+ loadingTip: PropTypes.string,
63
68
  };
64
69
 
65
70
  CardGrid.defaultProps = {