"src/pages/layouts/Header.js" did not exist on "cfbf108b7b2cb35e16e5312ab2e4f3199044cf76"
PageHeaderLayout.js 965 Bytes
Newer Older
1
import React from 'react';
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
2
import { FormattedMessage } from 'react-intl';
偏右's avatar
偏右 committed
3
import { Link } from 'dva/router';
ζ„šι“'s avatar
ζ„šι“ committed
4
import PageHeader from '../../components/PageHeader';
jim's avatar
jim committed
5
import GridContent from './GridContent';
afc163's avatar
afc163 committed
6
import styles from './PageHeaderLayout.less';
7
import MenuContext from './MenuContext';
8

Erwin Zhang's avatar
Erwin Zhang committed
9
const PageHeaderLayout = ({ children, wrapperClassName, top, ...restProps }) => (
afc163's avatar
afc163 committed
10
  <div style={{ margin: '-24px -24px 0' }} className={wrapperClassName}>
nikogu's avatar
nikogu committed
11
    {top}
jim's avatar
jim committed
12
    <MenuContext.Consumer>
jim's avatar
jim committed
13
      {value => {
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
14 15 16 17 18 19 20 21 22
        return (
          <PageHeader
            home={<FormattedMessage id="menu.home" defaultMessage="Home" />}
            {...value}
            key="pageheader"
            {...restProps}
            linkElement={Link}
          />
        );
jim's avatar
jim committed
23
      }}
jim's avatar
jim committed
24
    </MenuContext.Consumer>
jim's avatar
jim committed
25 26 27 28 29
    {children ? (
      <div className={styles.content}>
        <GridContent>{children}</GridContent>
      </div>
    ) : null}
30 31
  </div>
);
Erwin Zhang's avatar
Erwin Zhang committed
32 33

export default PageHeaderLayout;