mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-10 18:02:51 +00:00
working on api for getting unique list of dates
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
padding: 1em;
|
||||
|
||||
&:hover{
|
||||
background-color: gray;
|
||||
background-color: #D1D1D1;
|
||||
}
|
||||
|
||||
.item + .item{
|
||||
|
||||
Reference in New Issue
Block a user