GridContent.js 486 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() {
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
7
    const { grid, children } = this.props;
jim's avatar
jim committed
8
    let className = `${styles.main}`;
afc163's avatar
afc163 committed
9
    if (grid === '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 17
export default connect(({ setting }) => ({
  grid: setting.grid,
jim's avatar
jim committed
18
}))(GridContent);