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

class GridContent extends PureComponent {
  render() {
    let className = `${styles.main}`;
jim's avatar
jim committed
8 9
    if (this.props.grid === 'Wide') {
      className = `${styles.main} ${styles.wide}`;
jim's avatar
jim committed
10 11 12 13 14
    }
    return <div className={className}>{this.props.children}</div>;
  }
}

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