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
67
68
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import './styles.css';
const TopNav = (props) => (
<div className='top-nav'>
<div className="container clearfix">
<a href='/' className="logo clearfix float-left">
<img src='/img/logo.svg'/>
<div className="logo-text">
<h4>GitHunt</h4>
<p className="text-muted">Most starred projects on GitHub</p>
</div>
</a>
<div className="float-right duration-btns">
<a href="javascript:void(0)"
onClick={ () => props.updateDateType('year') }
className={
classNames('btn', {
'btn-primary': props.selectedDateType === 'year',
'btn-light': props.selectedDateType !== 'year',
})
}>
Yearly
</a>
<a href="javascript:void(0)"
onClick={ () => props.updateDateType('month') }
className={
classNames('btn', {
'btn-primary': props.selectedDateType === 'month',
'btn-light': props.selectedDateType !== 'month',
})
}>
Monthly
</a>
<a href="javascript:void(0)"
onClick={ () => props.updateDateType('week') }
className={
classNames('btn', {
'btn-primary': props.selectedDateType === 'week',
'btn-light': props.selectedDateType !== 'week',
})
}>
Weekly
</a>
<a href="javascript:void(0)"
onClick={ () => props.updateDateType('day') }
className={
classNames('btn', {
'btn-primary': props.selectedDateType === 'day',
'btn-light': props.selectedDateType !== 'day',
})
}>
Daily
</a>
</div>
</div>
</div>
);
TopNav.propTypes = {
updateDateType: PropTypes.func.isRequired,
selectedDateType: PropTypes.string
};
export default TopNav;
|