Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export function getDuckDuck () {
.catch(err => {
console.log(err.message)
})
}
}
2 changes: 1 addition & 1 deletion client/components/HoroscopeSearch.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { getHoroscopes } from '../api'
import {getHoroscopes} from '../api'

class HoroscopeSearch extends React.Component {
constructor (props) {
Expand Down
16 changes: 16 additions & 0 deletions client/components/Search.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'

import Weather from './Weather'
import HoroscopeSearch from './HoroscopeSearch'

const Search = () => {
return (
<div className='search'>
<h2>Search</h2>
<Weather />
<HoroscopeSearch />
</div>
)
}

export default Search
10 changes: 0 additions & 10 deletions client/components/Weather.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ class WeatherSearch extends React.Component {
temp_max: '',
temp_min: ''
},
/* sunTimes: {
sunrise: '',
sunset: ''
}, */
wind: {
speed: '',
deg: ''
Expand Down Expand Up @@ -55,7 +51,6 @@ class WeatherSearch extends React.Component {
.then(res => {
this.setState({
weather: res.body.main,
/* sunTimes: res.body.sys, */
wind: res.body.wind
})
})
Expand All @@ -65,7 +60,6 @@ class WeatherSearch extends React.Component {
}

render () {
console.log(Date(1536297759), Date(1536345198))
return (
<div className='form'>
<input value={this.state.city} onChange = {this.handleChange.bind(this)}/>
Expand All @@ -74,10 +68,6 @@ class WeatherSearch extends React.Component {
<p>{this.state.weather.temp && `Today the temperature in ${this.state.city} is ` + Math.round(Number(this.state.weather.temp)) + ' degrees Celsius.'}</p>
<p>{this.state.weather.temp_max && `High: ${this.state.weather.temp_max}` + ' degrees Celsius'}</p>
<p>{this.state.weather.temp_min && `Low: ${this.state.weather.temp_min}` + ' degrees Celsius'}</p>
{/* <p>{this.state.sunTimes.sunrise && `Sunrise: ${Date(this.state.sunTimes.sunrise)}`}</p>
<p>{this.state.sunTimes.sunset && `Sunset: ${Date(this.state.sunTimes.sunset)}`}</p> */}
{/* <p>{this.state.wind.speed && `The wind speed is ${this.state.wind.speed}`}</p> */}

</div>
)
}
Expand Down
1 change: 0 additions & 1 deletion client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ document.addEventListener('DOMContentLoaded', () => {
document.getElementById('app')
)
})