add styles to weather page

This commit is contained in:
2017-01-18 00:33:30 -08:00
parent 6714a949dd
commit 30af94b390
4 changed files with 8 additions and 8 deletions

View File

@@ -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>

View File

@@ -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>
);

View File

@@ -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>
)
};