1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-10 09:52:51 +00:00

working on api for getting unique list of dates

This commit is contained in:
2016-09-09 20:57:34 +00:00
parent 9c0aabe9aa
commit 0539eb740f
6 changed files with 76 additions and 52 deletions

View File

@@ -39,7 +39,7 @@ ReactDOM.render((
<Route path="/" component={App}>
<IndexRoute component={Preview}/>
<Route path="post/:category/:post" component={Post}/>
<Route path="sensor/:location/:year/:month" component={SensorInfo}/>
<Route path="sensor/:location" component={SensorInfo}/>
</Route>
</Router>
</Provider>

View File

@@ -20,8 +20,8 @@ export default class SensorList extends React.Component {
this.openLink = this.openLink.bind(this);
}
openLink(){
browserHistory.push("/");
openLink(location){
browserHistory.push(`/sensor/${location}`);
this.props.toggleOff();
}
@@ -29,7 +29,7 @@ export default class SensorList extends React.Component {
const date = new Date(sensor.updated);
return (
<div key={index} class="row" onClick={this.openLink}>
<div key={index} class="row" onClick={() => {this.openLink(sensor.location)}}>
<div class="item">
<h1>{sensor.temperature}°f</h1>
</div>

View File

@@ -9,7 +9,7 @@
padding: 1em;
&:hover{
background-color: gray;
background-color: #D1D1D1;
}
.item + .item{