PageHeaderLayout.js 714 Bytes
Newer Older
1
import React from 'react';
偏右's avatar
偏右 committed
2
import { Link } from 'dva/router';
3
import PageHeader from '../components/PageHeader';
jim's avatar
jim committed
4
import GridContent from './GridContent';
afc163's avatar
afc163 committed
5
import styles from './PageHeaderLayout.less';
jim's avatar
jim committed
6
import MeunContext from './MeunContext';
7

nikogu's avatar
nikogu committed
8
export default ({ children, wrapperClassName, top, ...restProps }) => (
afc163's avatar
afc163 committed
9
  <div style={{ margin: '-24px -24px 0' }} className={wrapperClassName}>
nikogu's avatar
nikogu committed
10
    {top}
jim's avatar
jim committed
11 12 13 14 15
    <MeunContext.Consumer>
      {value => {
        return <PageHeader {...value} key="pageheader" {...restProps} linkElement={Link} />;
      }}
    </MeunContext.Consumer>
jim's avatar
jim committed
16 17 18 19 20
    {children ? (
      <div className={styles.content}>
        <GridContent>{children}</GridContent>
      </div>
    ) : null}
21 22
  </div>
);