File size: 1,745 Bytes
181e22f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
  withRouter,
  matchPath,
} from 'react-router';

import {
  Link,
} from 'react-router-dom';

import styles from './NavBar.cm.styl';

function NavBar(props) {
  const pathname = props.location.pathname;

  const matchRecv = matchPath(pathname, '/recv/:recvCode?');

  return (
    <div className={styles.base}>
      <a href="/">
        <img src="/images/logo.png" alt="logo" className={styles.logo} />
      </a>
      <div className={styles.slogan}>
        简单安全高效的P2P文件传输服务
      </div>
      <div className={styles.menus}>
        <Link to="/send">
          <span
            className={classnames(styles.menu, pathname === '/send' && styles.active)}
          >
            发送文件
          </span>
        </Link>
        <Link to="/recv">
          <span
            className={classnames(styles.menu, matchRecv && styles.active)}
          >
            接收文件
          </span>
        </Link>
        <a href="https://wonderfulcv.com" target="_blank" className={styles.ad}>
          橙子简历(友情链接)
          <div className={styles.adQrcode}>
            <div className={styles.cvDesc}>
              微信扫码立即制作简历
            </div>
            <img src="/images/qrcode_wechat.jpg" />
          </div>
        </a>

      </div>
      <a className="github-button" href="https://github.com/fanchangyong/deershare" data-size="large" data-show-count="true" aria-label="Star fanchangyong/deershare on GitHub">Star</a>
    </div>
  );
}

NavBar.defaultProps = {};

NavBar.propTypes = {
  location: PropTypes.object,
};

export default withRouter(NavBar);