GridContent.js 518 Bytes
Newer Older
jim's avatar
jim committed
1 2 3 4 5 6
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import styles from './GridContent.less';

class GridContent extends PureComponent {
  render() {
afc163's avatar
afc163 committed
7
    const { contentWidth, children } = this.props;
jim's avatar
jim committed
8
    let className = `${styles.main}`;
afc163's avatar
afc163 committed
9
    if (contentWidth === 'Fixed') {
jim's avatar
jim committed
10
      className = `${styles.main} ${styles.wide}`;
jim's avatar
jim committed
11
    }
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
12
    return <div className={className}>{children}</div>;
jim's avatar
jim committed
13 14 15
  }
}

jim's avatar
jim committed
16
export default connect(({ setting }) => ({
afc163's avatar
afc163 committed
17
  contentWidth: setting.contentWidth,
jim's avatar
jim committed
18
}))(GridContent);