From 6aca76ed03babbf2104fca8c4a27819256d2cc5c Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sun, 1 Apr 2018 13:17:31 +0530 Subject: [PATCH] Add SingleDayForecast --- .../SingleDayForecast/Component.css | 21 +++++++++++++ .../SingleDayForecast/Component.tsx | 30 +++++++++++++++++++ src/Components/SingleDayForecast/index.tsx | 1 + 3 files changed, 52 insertions(+) create mode 100644 src/Components/SingleDayForecast/Component.css create mode 100644 src/Components/SingleDayForecast/Component.tsx create mode 100644 src/Components/SingleDayForecast/index.tsx diff --git a/src/Components/SingleDayForecast/Component.css b/src/Components/SingleDayForecast/Component.css new file mode 100644 index 0000000..76b6235 --- /dev/null +++ b/src/Components/SingleDayForecast/Component.css @@ -0,0 +1,21 @@ +.WeatherApp { + text-align: center; +} + +.WeatherApp-header { + background-color: #222; + color: white; + + width: 100%; + height: 10vh; +} + +.WeatherApp-title { + padding: 3.5vh 0; + font-size: 3vh; +} + +.WeatherApp-body { + width: 100%; + height: 90vh; +} \ No newline at end of file diff --git a/src/Components/SingleDayForecast/Component.tsx b/src/Components/SingleDayForecast/Component.tsx new file mode 100644 index 0000000..5d9d997 --- /dev/null +++ b/src/Components/SingleDayForecast/Component.tsx @@ -0,0 +1,30 @@ +import * as React from 'react'; +import './Component.css'; +import { ForecaseAtInstance } from '../WeatherApp'; + +export interface SingleDayForecastProps { + forecastDay: Array; +} + +export class SingleDayForecast extends React.Component { + + constructor(props: SingleDayForecastProps) { + super(props); + + this.props = props; + + // this.state = { data: undefined }; + } + + componentWillUpdate(nextProps: SingleDayForecastProps) { + this.props = this.props; + } + + render() { + return ( +
+ {JSON.stringify(this.props)}; +
+ ); + } +} diff --git a/src/Components/SingleDayForecast/index.tsx b/src/Components/SingleDayForecast/index.tsx new file mode 100644 index 0000000..c70ccea --- /dev/null +++ b/src/Components/SingleDayForecast/index.tsx @@ -0,0 +1 @@ +export { SingleDayForecast } from './Component'; \ No newline at end of file