GridContent.js 455 Bytes
Newer Older
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
1
import React from 'react';
jim's avatar
jim committed
2 3 4
import { connect } from 'dva';
import styles from './GridContent.less';

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

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