UserLayout.js 1.83 KB
Newer Older
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
1
import React, { Fragment } from 'react';
2
import { formatMessage } from 'umi/locale';
zinkey's avatar
zinkey committed
3
import Link from 'umi/link';
4
import { Icon } from 'antd';
5
import GlobalFooter from '@/components/GlobalFooter';
6
import styles from './UserLayout.less';
7
import logo from '../assets/logo.svg';
xiaohu's avatar
xiaohu committed
8

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

jim's avatar
jim committed
27 28 29 30 31
const copyright = (
  <Fragment>
    Copyright <Icon type="copyright" /> 2018 ่š‚่š้‡‘ๆœไฝ“้ชŒๆŠ€ๆœฏ้ƒจๅ‡บๅ“
  </Fragment>
);
32

33
class UserLayout extends React.PureComponent {
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
34
  // @TODO title
35 36 37 38 39 40 41 42 43
  // 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;
  // }
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
44

45
  render() {
xiaohu's avatar
xiaohu committed
46
    const { children } = this.props;
47
    return (
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
48
      // @TODO <DocumentTitle title={this.getPageTitle()}>
49 50 51 52 53 54 55 56
      <div className={styles.container}>
        <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>
57
            </div>
58 59 60
            <div className={styles.desc}>Ant Design ๆ˜ฏ่ฅฟๆน–ๅŒบๆœ€ๅ…ทๅฝฑๅ“ๅŠ›็š„ Web ่ฎพ่ฎก่ง„่Œƒ</div>
          </div>
          {children}
61
        </div>
62 63
        <GlobalFooter links={links} copyright={copyright} />
      </div>
64 65 66 67 68
    );
  }
}

export default UserLayout;