UserLayout.jsx 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { DefaultFooter, getMenuData, getPageTitle } from '@ant-design/pro-layout';
  2. import DocumentTitle from 'react-document-title';
  3. import Link from 'umi/link';
  4. import React from 'react';
  5. import { connect } from 'dva';
  6. import { formatMessage } from 'umi-plugin-react/locale';
  7. import SelectLang from '@/components/SelectLang';
  8. import logo from '../assets/logo.svg';
  9. import styles from './UserLayout.less';
  10. const UserLayout = props => {
  11. const {
  12. route = {
  13. routes: [],
  14. },
  15. } = props;
  16. const { routes = [] } = route;
  17. const {
  18. children,
  19. location = {
  20. pathname: '',
  21. },
  22. } = props;
  23. const { breadcrumb } = getMenuData(routes);
  24. return (
  25. <DocumentTitle
  26. title={getPageTitle({
  27. pathname: location.pathname,
  28. breadcrumb,
  29. formatMessage,
  30. ...props,
  31. })}
  32. >
  33. <div className={styles.container}>
  34. <div className={styles.content}>
  35. {children}
  36. </div>
  37. </div>
  38. </DocumentTitle>
  39. );
  40. };
  41. export default connect(({ settings }) => ({ ...settings }))(UserLayout);