UserLayout.js 2.0 KB
Newer Older
陈帅 已提交
1
import React, { Fragment } from 'react';
2
import { formatMessage } from 'umi/locale';
Z
zinkey 已提交
3
import Link from 'umi/link';
4
import { Icon } from 'antd';
5
import GlobalFooter from '@/components/GlobalFooter';
6
import SelectLang from '@/components/SelectLang';
7
import styles from './UserLayout.less';
S
sorrycc 已提交
8
import logo from '../assets/logo.svg';
陈小聪-小虎Oni's avatar
陈小聪-小虎Oni 已提交
9

J
jim 已提交
10 11 12
const links = [
  {
    key: 'help',
13
    title: formatMessage({ id: 'layout.user.link.help' }),
J
jim 已提交
14 15 16 17
    href: '',
  },
  {
    key: 'privacy',
18
    title: formatMessage({ id: 'layout.user.link.privacy' }),
J
jim 已提交
19 20 21 22
    href: '',
  },
  {
    key: 'terms',
23
    title: formatMessage({ id: 'layout.user.link.terms' }),
J
jim 已提交
24 25 26
    href: '',
  },
];
27

J
jim 已提交
28 29 30 31 32
const copyright = (
  <Fragment>
    Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
  </Fragment>
);
33

34
class UserLayout extends React.PureComponent {
陈帅 已提交
35
  // @TODO title
愚道 已提交
36 37 38 39 40 41 42 43 44
  // getPageTitle() {
  //   const { routerData, location } = this.props;
  //   const { pathname } = location;
  //   let title = 'Ant Design Pro';
  //   if (routerData[pathname] && routerData[pathname].name) {
  //     title = `${routerData[pathname].name} - Ant Design Pro`;
  //   }
  //   return title;
  // }
陈帅 已提交
45

46
  render() {
陈小聪-小虎Oni's avatar
陈小聪-小虎Oni 已提交
47
    const { children } = this.props;
48
    return (
陈帅 已提交
49
      // @TODO <DocumentTitle title={this.getPageTitle()}>
愚道 已提交
50
      <div className={styles.container}>
51 52 53
        <div className={styles.lang}>
          <SelectLang />
        </div>
愚道 已提交
54 55 56 57 58 59 60
        <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>
61
            </div>
愚道 已提交
62 63 64
            <div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
          </div>
          {children}
65
        </div>
愚道 已提交
66 67
        <GlobalFooter links={links} copyright={copyright} />
      </div>
68 69 70 71 72
    );
  }
}

export default UserLayout;