正在显示
3 个修改的文件
包含
10 行增加
和
49 行删除
| 1 | -import React from 'react'; | ||
| 2 | -import { FormattedMessage } from 'umi/locale'; | ||
| 3 | -import Link from 'umi/link'; | ||
| 4 | -import { PageHeader } from 'ant-design-pro'; | ||
| 5 | -import styles from './index.less'; | ||
| 6 | - | ||
| 7 | -const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | ||
| 8 | - <div style={{ margin: '-24px -24px 0' }} className={wrapperClassName}> | ||
| 9 | - <PageHeader | ||
| 10 | - home={<FormattedMessage id="BLOCK_BAME.menu.home" defaultMessage="Home" />} | ||
| 11 | - key="pageheader" | ||
| 12 | - {...restProps} | ||
| 13 | - linkElement={Link} | ||
| 14 | - itemRender={item => { | ||
| 15 | - if (item.locale) { | ||
| 16 | - return <FormattedMessage id={item.locale} defaultMessage={item.title} />; | ||
| 17 | - } | ||
| 18 | - return item.title; | ||
| 19 | - }} | ||
| 20 | - /> | ||
| 21 | - {children ? <div className={styles.content}>{children}</div> : null} | ||
| 22 | - </div> | ||
| 23 | -); | ||
| 24 | - | ||
| 25 | -export default PageHeaderWrapper; |
| @@ -2,7 +2,6 @@ import React, { Fragment } from 'react'; | @@ -2,7 +2,6 @@ import React, { Fragment } from 'react'; | ||
| 2 | import { formatMessage, FormattedMessage } from 'umi/locale'; | 2 | import { formatMessage, FormattedMessage } from 'umi/locale'; |
| 3 | import { Button, Icon, Card } from 'antd'; | 3 | import { Button, Icon, Card } from 'antd'; |
| 4 | import { Result } from 'ant-design-pro'; | 4 | import { Result } from 'ant-design-pro'; |
| 5 | -import PageHeaderWrapper from './components/PageHeaderWrapper'; | ||
| 6 | 5 | ||
| 7 | const extra = ( | 6 | const extra = ( |
| 8 | <Fragment> | 7 | <Fragment> |
| @@ -51,16 +50,14 @@ const actions = ( | @@ -51,16 +50,14 @@ const actions = ( | ||
| 51 | ); | 50 | ); |
| 52 | 51 | ||
| 53 | export default () => ( | 52 | export default () => ( |
| 54 | - <PageHeaderWrapper> | ||
| 55 | - <Card bordered={false}> | ||
| 56 | - <Result | ||
| 57 | - type="error" | ||
| 58 | - title={formatMessage({ id: 'BLOCK_BAME.error.title' })} | ||
| 59 | - description={formatMessage({ id: 'BLOCK_BAME.error.description' })} | ||
| 60 | - extra={extra} | ||
| 61 | - actions={actions} | ||
| 62 | - style={{ marginTop: 48, marginBottom: 16 }} | ||
| 63 | - /> | ||
| 64 | - </Card> | ||
| 65 | - </PageHeaderWrapper> | 53 | + <Card bordered={false}> |
| 54 | + <Result | ||
| 55 | + type="error" | ||
| 56 | + title={formatMessage({ id: 'BLOCK_BAME.error.title' })} | ||
| 57 | + description={formatMessage({ id: 'BLOCK_BAME.error.description' })} | ||
| 58 | + extra={extra} | ||
| 59 | + actions={actions} | ||
| 60 | + style={{ marginTop: 48, marginBottom: 16 }} | ||
| 61 | + /> | ||
| 62 | + </Card> | ||
| 66 | ); | 63 | ); |
请
注册
或
登录
后发表评论