UserLayout.js 1.61 KB
Newer Older
dengxiaofeng's avatar
dengxiaofeng committed
1 2
import React from 'react';

张烨's avatar
张烨 committed
3
import { Helmet, HelmetProvider } from 'react-helmet-async';
dengxiaofeng's avatar
dengxiaofeng committed
4 5
import { renderRoutes } from 'react-router-config';

dengxiaofeng's avatar
dengxiaofeng committed
6 7 8 9 10
import {
  DefaultFooter,
  getMenuData,
  getPageTitle,
} from '@ant-design/pro-layout';
dengxiaofeng's avatar
dengxiaofeng committed
11

12
import logo from '../assets/images/logo/panda-logo.svg';
dengxiaofeng's avatar
dengxiaofeng committed
13
import styles from './UserLayout.less';
dengxiaofeng's avatar
dengxiaofeng committed
14 15 16 17 18 19

const UserLayout = props => {
  const {
    route = {
      routes: [],
    },
张烨's avatar
张烨 committed
20
    children,
dengxiaofeng's avatar
dengxiaofeng committed
21
  } = props;
dengxiaofeng's avatar
dengxiaofeng committed
22 23 24
  // const { formatMessage } = useIntl();
  const { breadcrumb } = getMenuData(route.routes);
  const title = getPageTitle({
张烨's avatar
张烨 committed
25
    pathname: window.location.pathname,
dengxiaofeng's avatar
dengxiaofeng committed
26 27 28 29 30
    // formatMessage,
    breadcrumb,
    ...props,
  });

dengxiaofeng's avatar
dengxiaofeng committed
31 32 33
  return (
    <HelmetProvider>
      <Helmet>
dengxiaofeng's avatar
dengxiaofeng committed
34 35
        <title>{title}</title>
        <meta name="description" content={title} />
dengxiaofeng's avatar
dengxiaofeng committed
36 37
      </Helmet>

dengxiaofeng's avatar
dengxiaofeng committed
38
      <div className={styles.container}>
张烨's avatar
张烨 committed
39
        <div className={styles.lang}>{/* <SelectLang /> */}</div>
dengxiaofeng's avatar
dengxiaofeng committed
40 41 42
        <div className={styles.content}>
          <div className={styles.top}>
            <div className={styles.header}>
张烨's avatar
张烨 committed
43
              <img alt="logo" className={styles.logo} src={logo} />
44
              <span className={styles.title}>熊猫水务运维平台</span>
张烨's avatar
张烨 committed
45 46
            </div>
            <div className={styles.desc}>
47
              {/* Ant Design 是西湖区最具影响力的 Web 设计规范 */}
dengxiaofeng's avatar
dengxiaofeng committed
48 49
            </div>
          </div>
张烨's avatar
张烨 committed
50
          {children || renderRoutes(route.routes)}
dengxiaofeng's avatar
dengxiaofeng committed
51
        </div>
张烨's avatar
张烨 committed
52 53
        <DefaultFooter
          copyright={`${new Date().getFullYear()} 熊猫智慧水务技术委员会出品`}
54
          links={[]}
张烨's avatar
张烨 committed
55
        />
dengxiaofeng's avatar
dengxiaofeng committed
56 57 58 59 60 61
      </div>
    </HelmetProvider>
  );
};

export default UserLayout;