GridContent.js 485 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}`;
陈帅's avatar
陈帅 committed
9
    if (grid === 'Wide') {
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);