Skip to content

Instantly share code, notes, and snippets.

@Louiefigz
Created May 14, 2017 00:03
Show Gist options
  • Save Louiefigz/5283046f4993cb4ebde3b267106efe79 to your computer and use it in GitHub Desktop.
Save Louiefigz/5283046f4993cb4ebde3b267106efe79 to your computer and use it in GitHub Desktop.
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