Created
May 14, 2017 00:03
-
-
Save Louiefigz/5283046f4993cb4ebde3b267106efe79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Col} from 'react-bootstrap'; | |
import { browserHistory } from 'react-router'; | |
class DayWeather extends Component { | |
constructor() { | |
super(); | |
this.handleClick = this.handleClick.bind(this) | |
} | |
handleClick() { | |
let path = `/detail/${this.props.city}` | |
browserHistory.push({ | |
pathname: path, | |
state: { | |
city: this.props.city, | |
date: this.props.date, | |
data: this.props.data | |
} | |
}) | |
} | |
render() { | |
return ( | |
<Col onClick={this.handleClick} xs={6} md={3} className="DayWeather"> | |
<h3 className="Date">{this.props.date}</h3> | |
</Col> | |
) | |
} | |
} | |
export default DayWeather; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment