You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.8 KiB
65 lines
1.8 KiB
import { ConnectProps, ConnectState } from '@/models/connect';
|
|
import { DefaultFooter, MenuDataItem, getMenuData, getPageTitle } from '@ant-design/pro-layout';
|
|
|
|
import DocumentTitle from 'react-document-title';
|
|
import Link from 'umi/link';
|
|
import React from 'react';
|
|
import SelectLang from '@/components/SelectLang';
|
|
import { connect } from 'dva';
|
|
import { formatMessage } from 'umi-plugin-react/locale';
|
|
import logo from '../assets/logo.svg';
|
|
import styles from './UserLayout.less';
|
|
|
|
export interface UserLayoutProps extends ConnectProps {
|
|
breadcrumbNameMap: { [path: string]: MenuDataItem };
|
|
}
|
|
|
|
const UserLayout: React.SFC<UserLayoutProps> = props => {
|
|
const {
|
|
route = {
|
|
routes: [],
|
|
},
|
|
} = props;
|
|
const { routes = [] } = route;
|
|
const {
|
|
children,
|
|
location = {
|
|
pathname: '',
|
|
},
|
|
} = props;
|
|
const { breadcrumb } = getMenuData(routes, props);
|
|
|
|
return (
|
|
<DocumentTitle
|
|
title={getPageTitle({
|
|
pathname: location.pathname,
|
|
breadcrumb,
|
|
formatMessage,
|
|
...props,
|
|
})}
|
|
>
|
|
<div className={styles.container}>
|
|
<div className={styles.lang}>
|
|
<SelectLang />
|
|
</div>
|
|
<div className={styles.content}>
|
|
<div className={styles.top}>
|
|
<div className={styles.header}>
|
|
<Link to="/">
|
|
<img alt="logo" className={styles.logo} src={logo} />
|
|
<span className={styles.title}>Ant Design</span>
|
|
</Link>
|
|
</div>
|
|
<div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
|
|
</div>
|
|
{children}
|
|
</div>
|
|
<DefaultFooter />
|
|
</div>
|
|
</DocumentTitle>
|
|
);
|
|
};
|
|
|
|
export default connect(({ settings }: ConnectState) => ({
|
|
...settings,
|
|
}))(UserLayout);
|
|
|