-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
79 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import React, {Component} from 'react'; | ||
// component | ||
import dateHelper from './utils/dateHelper'; | ||
|
||
class Day extends Component { | ||
render() { | ||
return ( | ||
|
||
) | ||
} | ||
const Day = (props) => { | ||
var date = props.day.dt; | ||
var pic = props.day.weather["0"].icon; | ||
return ( | ||
<div className="day-container"> | ||
<div className="day-item" onClick={props.onClick}> | ||
<img className="day-pic" src={require("./img/weather-icons/" + pic + ".svg")} alt="" /> | ||
<p className="day-title">{dateHelper.convertTimestamp(date)}</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Day; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { Component } from 'react'; | ||
import Day from './Day'; | ||
import dateHelper from './utils/dateHelper'; | ||
|
||
class Details extends Component { | ||
render() { | ||
var day = this.props.location.state; | ||
return ( | ||
<div> | ||
<Day key={day.dt} day={day}/> | ||
<div className="details-container"> | ||
<p>{day.weather[0].description}</p> | ||
<p>min temp: {dateHelper.convertTemp(day.temp.min)}</p> | ||
<p>max temp: {dateHelper.convertTemp(day.temp.max)}</p> | ||
<p>humidity: {day.humidity}</p> | ||
</div> | ||
{/* {JSON.stringify(day.humidity)} */} | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default Details; |
This file contains 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
This file contains 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