forked from speedtracker/speedtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTopBar.js
More file actions
52 lines (47 loc) 路 1.52 KB
/
Copy pathTopBar.js
File metadata and controls
52 lines (47 loc) 路 1.52 KB
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
import React from 'react'
import { render } from 'react-dom'
import Logo from './Logo'
import LogoTitle from './LogoTitle'
class TopBar extends React.Component {
_onPeriodChange(event) {
this.props.onPeriodChange(event.target.value)
}
_onProfileChange(event) {
this.props.onProfileChange(event.target.value)
}
render() {
return (
<div className="c-TopBar">
<div className="c-TopBar__inner">
<a href="https://speedtracker.org">
<Logo width={40}/>
<LogoTitle width={140}/>
</a>
<div className="c-TopBar__nav">
<p>
Viewing
<select className="c-TopBar__select"
value={this.props.profile.slug}
onChange={this._onProfileChange.bind(this)}>
{this.props.profiles.map(profile => {
return (
<option key={profile.slug} value={profile.slug}>{profile.name}</option>
)
})}
</select> in the last
<select className="c-TopBar__select"
value={this.props.period}
onChange={this._onPeriodChange.bind(this)}>
<option value="day">day</option>
<option value="week">week</option>
<option value="month">month</option>
<option value="year">year</option>
</select>
</p>
</div>
</div>
</div>
)
}
}
export default TopBar