Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit957b14f

Browse files
committed
added title
1 parent026bba9 commit957b14f

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

‎src/components/app.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import React, { Component } from 'react';
22

33
importSearchBarfrom'../containers/search_bar';
44
importWeatherListfrom'../containers/weather_list';
5+
importHeaderfrom'./header';
56

67
exportdefaultclassAppextendsComponent{
78
render(){
89
return(
910
<div>
11+
<Header/>
1012
<SearchBar/>
1113
<WeatherList/>
1214
</div>

‎src/components/header.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
importReact,{Component}from'react'
2+
3+
exportdefaultclassHeaderextendsComponent{
4+
render(){
5+
return(
6+
<h1>Five Day Forecast</h1>
7+
);
8+
}
9+
}

‎src/containers/weather_list.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
importReact,{Component}from'react';
22
import{connect}from'react-redux';
33
importChartfrom'../components/chart';
4-
4+
importGoogleMapfrom'../components/google_map'
55

66
classWeatherListextendsComponent{
77
renderWeather(cityData){
@@ -10,10 +10,12 @@ class WeatherList extends Component {
1010
consttemps=list.map((weather)=>weather.main.temp);
1111
constpressure=list.map((weather)=>weather.main.pressure);
1212
consthumidity=list.map((weather)=>weather.main.humidity);
13-
console.log(cityData);
13+
const{ lon, lat}=cityData.city.coord;
14+
1415
return(
1516
<trkey={name}>
1617
<td>{name}</td>
18+
<td><GoogleMaplon={lon}lat={lat}/></td>
1719
<td><Chartdata={temps}color="blue"units="&deg;F"/></td>
1820
<td><Chartdata={pressure}color="orange"units="hPa"/></td>
1921
<td><Chartdata={humidity}color="black"units="%"/></td>
@@ -27,6 +29,7 @@ class WeatherList extends Component {
2729
<thead>
2830
<tr>
2931
<th>City</th>
32+
<th>Map</th>
3033
<th>Temp (&deg;F)</th>
3134
<th>Pressure (hPa)</th>
3235
<th>Humidity (%)</th>

‎style/style.css‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1+
* {
2+
margin:0;
3+
}
4+
5+
h1 {
6+
text-align: center;
7+
margin:20px0;
8+
}
9+
110
td,th {
211
vertical-align: middle!important;
312
text-align: center!important;
413
}
514

615
.input-group {
716
margin:20px0;
17+
}
18+
19+
td:nth-of-type(2),td:nth-of-type(2)>div {
20+
height:200px;
21+
width:250px;
822
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp