mirror of
https://github.com/Raghu-Ch/ReactWeather.git
synced 2026-02-10 11:03:02 -05:00
add styles to weather page
This commit is contained in:
@@ -11,7 +11,7 @@ var Weather = React.createClass({
|
||||
},
|
||||
handleSearch: function (location) {
|
||||
var that = this;
|
||||
|
||||
|
||||
this.setState({isLoading: true});
|
||||
|
||||
openWeatherMap.getTemp(location).then(function (temp) {
|
||||
@@ -30,7 +30,7 @@ var Weather = React.createClass({
|
||||
|
||||
function renderMessage () {
|
||||
if (isLoading) {
|
||||
return <h3>Fetching weather...</h3>;
|
||||
return <h1>Fetching weather...</h1>;
|
||||
} else if (temp && location) {
|
||||
return <WeatherMessage temp={temp} location={location}/>;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ var Weather = React.createClass({
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h3>Weather Component</h3>
|
||||
<h1 className="text-center">Get Weather</h1>
|
||||
<WeatherForm onSearch={this.handleSearch}/>
|
||||
{renderMessage()}
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ var WeatherForm = React.createClass({
|
||||
<div>
|
||||
<form onSubmit={this.onFormSubmit}>
|
||||
<input type="text" ref="location"/>
|
||||
<button>Get Weather</button>
|
||||
<button className="button expanded hollow">Get Weather</button>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ var React = require('react');
|
||||
// (or)
|
||||
var WeatherMessage = ({temp, location}) => {
|
||||
return (
|
||||
<h3>It's it {temp} in {location}.</h3>
|
||||
<h3 className="text-center">It's it {temp} in {location}.</h3>
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user