-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
52 lines (47 loc) · 1.11 KB
/
App.jsx
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
//App component - represents the whool app
App = React.createClass({
//This mixin makes the getMeteorData mehtod work
mixins: [ReactMeteorData],
skillSelect(){
if($('select').val() === 'Wod' ){
console.log('wod');
};
if($('select').val() === 'Strength/Skill' ){
console.log('skill');
};
if($('select').val() === 'Other' ){
console.log('other');
}
},
getMeteorData(){
return{
wods: Wods.find({}).fetch(),
}
},
renderWods() {
//Get wods from this.data.wads
console.log(this.data.wods);
return this.data.wods.map((wod) => {
return wod;
});
},
render(){
return (
<div className="container">
<header>
<h1>Wod Tracker</h1>
<form>
<select onChange={this.skillSelect}>
<option name='wod'>Wod</option>
<option name='skill'>Strength/Skill</option>
<option name='other'>Other</option>
</select>
</form>
<Wod />
</header>
<wods wods={this.data.wods}/>
{this.data.wods.wodname}
</div>
);
},
})