diff --git a/package-lock.json b/package-lock.json index 2def5cb..a27a91c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10087,6 +10087,11 @@ "minimist": "^1.2.5" } }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -12380,6 +12385,11 @@ "prop-types": "^15.7.2" } }, + "react-moment": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/react-moment/-/react-moment-1.1.1.tgz", + "integrity": "sha512-WjwvxBSnmLMRcU33do0KixDB+9vP3e84eCse+rd+HNklAMNWyRgZTDEQlay/qK6lcXFPRuEIASJTpEt6pyK7Ww==" + }, "react-redux": { "version": "7.2.4", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.4.tgz", diff --git a/package.json b/package.json index cf47679..580d2a1 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,12 @@ "@types/react": "^17.0.11", "@types/react-dom": "^17.0.8", "axios": "^0.21.1", + "moment": "^2.29.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-icons": "^4.2.0", "react-loader-spinner": "^4.0.0", + "react-moment": "^1.1.1", "react-redux": "^7.2.4", "react-scripts": "4.0.3", "redux": "^4.1.0", diff --git a/src/components/layouts/Aside.tsx b/src/components/layouts/Aside.tsx index 253684e..f4f7128 100644 --- a/src/components/layouts/Aside.tsx +++ b/src/components/layouts/Aside.tsx @@ -1,6 +1,9 @@ +import { Fragment } from "react"; +import Moment from "react-moment"; import cloudBackground from "../../assets/Cloud-background.png"; import { MdMyLocation, MdLocationOn } from "react-icons/md"; -import showerIcon from "../../assets/Shower.png"; +import { useTypedSelector } from "../hooks/useTypedSelector"; +import showWeatherImage from "./../showWeatherImage"; interface Props { setOpenSearch: (openSearch: boolean) => void; @@ -8,6 +11,8 @@ interface Props { } const AsideContent: React.FC = ({ openSearch, setOpenSearch }) => { + const { weatherData } = useTypedSelector((state) => state.weather); + return (
= ({ openSearch, setOpenSearch }) => {
+
- Weather Icon -
-

- 15o - C -

-

Shower

-

Today - Fri Jun 5

-
- -

Helsinki

-
-
+ {weatherData && ( + + Weather Icon +
+

+ {Math.ceil(weatherData.consolidated_weather[0].the_temp)} + o + C +

+

+ {weatherData.consolidated_weather[0].weather_state_name} +

+

+ Today -{" "} + + {weatherData.consolidated_weather[0].applicable_date} + +

+
+ +

{weatherData.title}

+
+
+
+ )}
); diff --git a/src/components/showWeatherImage.ts b/src/components/showWeatherImage.ts new file mode 100644 index 0000000..98c2739 --- /dev/null +++ b/src/components/showWeatherImage.ts @@ -0,0 +1,39 @@ +import clear from "../assets/Clear.png"; +import hail from "../assets/Hail.png"; +import heavyCloud from "../assets/HeavyCloud.png"; +import lightCloud from "../assets/LightCloud.png"; +import heavyRain from "../assets/HeavyRain.png"; +import lightRain from "../assets/LightRain.png"; +import shower from "../assets/Shower.png"; +import sleet from "../assets/Sleet.png"; +import snow from "../assets/Snow.png"; +import thunderstorm from "../assets/Thunderstorm.png"; + +const showWeatherImage = (image: string) => { + switch (image) { + case "sn": + return snow; + case "sl": + return sleet; + case "h": + return hail; + case "t": + return thunderstorm; + case "hr": + return heavyRain; + case "lr": + return lightRain; + case "s": + return shower; + case "hc": + return heavyCloud; + case "lc": + return lightCloud; + case "c": + return clear; + default: + return clear; + } +}; + +export default showWeatherImage; diff --git a/src/sass/index.css b/src/sass/index.css index 5dd3935..44c03e5 100644 --- a/src/sass/index.css +++ b/src/sass/index.css @@ -414,9 +414,6 @@ a { -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; - -webkit-box-pack: space-evenly; - -ms-flex-pack: space-evenly; - justify-content: space-evenly; -webkit-box-align: center; -ms-flex-align: center; align-items: center; @@ -424,9 +421,14 @@ a { padding-top: 7em; } +.aside__weather__icon { + width: 22em; +} + .aside__weather__degree { font-size: 10rem; font-weight: 400; + margin-top: 0.25em; } .aside__weather__degree sup { @@ -448,7 +450,7 @@ a { } .aside__weather__date { - font-size: 1.2rem; + font-size: 1.5rem; color: #88869d; } @@ -462,9 +464,10 @@ a { -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; - font-weight: 600; + font-weight: 500; color: #88869d; margin-top: 3em; + font-size: 1.5rem; } .aside__weather__location p { diff --git a/src/sass/index.css.map b/src/sass/index.css.map index 9025a2a..d3cd69a 100644 --- a/src/sass/index.css.map +++ b/src/sass/index.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AGAA,AAAA,CAAC;AACD,CAAC,AAAA,QAAQ;AACT,CAAC,AAAA,OAAO,CAAC;EACP,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,CAAC;EACT,UAAU,EAAE,UAAU;CACvB;;AAED,AAAA,IAAI,CAAC;EACH,SAAS,EAAE,KAAK;CACjB;;AAED,AAAA,IAAI,CAAC;EACH,UAAU,EDZI,OAAO;ECarB,KAAK,EDVO,OAAO;ECWnB,WAAW,EAAE,qBAAqB;CACnC;;AAED,AAAA,EAAE,CAAC;EACD,UAAU,EAAE,IAAI;CACjB;;AAED,AAAA,CAAC,CAAC;EACA,eAAe,EAAE,IAAI;CACtB;;ACxBD,AAAA,kBAAkB,CAAC;EACjB,OAAO,EAAE,IAAI;EACb,qBAAqB,EAAE,OAAO;EAC9B,QAAQ,EAAE,GAAG;CA8Ed;;AA5EE,AAAD,2BAAU,CAAC;EACT,UAAU,EFJI,OAAO;EEKrB,OAAO,EAAE,KAAK;EHIhB,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,WAAW,EAAE,MAAM;EGJjB,eAAe,EAAE,MAAM;CAKxB;;AAHE,AAAD,gCAAM,CAAC;EACL,OAAO,EAAE,KAAK;CACf;;AAGF,AAAD,wBAAO,CAAC;EACN,SAAS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,ECDC,OAAO;EDElB,aAAa,EAAE,GAAG;EUEd,OAAO,EAAE,KAAK;EACd,MAAM,EAAE,GAAG;EACX,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,CAAC;EACT,MAAM,EAAE,OAAO;CAoBhB;;AAjCL,AAeM,QAfE,CAeD,sCAAS,CAAC;EACT,UAAU,ETZJ,OAAO;ESab,KAAK,ETHK,OAAO;ESIjB,YAAY,EAAE,GAAG;CAKlB;;AAvBP,AAoBQ,QApBA,CAeD,sCAAS,AAKP,OAAO,CAAC;EACP,UAAU,ETZC,OAAO;CSanB;;AAtBT,AAyBM,QAzBE,CAyBD,yCAAY,CAAC;EACZ,UAAU,ETvBD,OAAO;ESwBhB,KAAK,ETvBC,OAAO;CS4Bd;;AAhCP,AA6BQ,QA7BA,CAyBD,yCAAY,AAIV,OAAO,CAAC;EACP,UAAU,ETfA,OAAO;CSgBlB;;AA/BT,AAoCE,QApCM,CAoCN,oBAAoB,CAAC;EACnB,UAAU,EAAE,GAAG;CAOhB;;AA5CH,AAuCI,QAvCI,CAuCH,2BAAO,CAAC;EACP,SAAS,EAAE,MAAM;EACjB,WAAW,EAAE,GAAG;EAChB,aAAa,EAAE,GAAG;CACnB", "sources": [ "index.scss", "abstracts/_mixins.scss", diff --git a/src/sass/layout/_aside.scss b/src/sass/layout/_aside.scss index 03a3696..8b09b08 100644 --- a/src/sass/layout/_aside.scss +++ b/src/sass/layout/_aside.scss @@ -62,14 +62,18 @@ width: 100%; display: flex; flex-direction: column; - justify-content: space-evenly; align-items: center; text-align: center; padding-top: 7em; + &__icon { + width: 22em; + } + &__degree { font-size: 10rem; font-weight: 400; + margin-top: 0.25em; & sup { font-size: 2rem; @@ -91,7 +95,7 @@ } &__date { - font-size: 1.2rem; + font-size: 1.5rem; color: $color-grey-light; } @@ -99,9 +103,10 @@ display: flex; align-items: center; justify-content: center; - font-weight: 600; + font-weight: 500; color: $color-grey-light; margin-top: 3em; + font-size: 1.5rem; & p { margin-left: 0.25rem; diff --git a/src/store/action-creators/index.ts b/src/store/action-creators/index.ts index dd57c92..809e072 100644 --- a/src/store/action-creators/index.ts +++ b/src/store/action-creators/index.ts @@ -4,7 +4,7 @@ import { Action } from "../actions"; import axios from "axios"; const BASE_URL = - "https://cors-anywhere-venky.herokuapp.com/https://www.metaweather.com/api/location/"; + "https://rhubarb-crumble-16507.herokuapp.com/https://www.metaweather.com/api/location/"; export const fetchWeatherData = (woeid: number) => async (dispatch: Dispatch) => { diff --git a/src/store/actions/index.ts b/src/store/actions/index.ts index d820e1f..2411c03 100644 --- a/src/store/actions/index.ts +++ b/src/store/actions/index.ts @@ -1,4 +1,5 @@ import { ActionTypes } from "../action-types"; +import { WeatherDataset } from "../reducers/weatherReducer"; interface GetWeatherDataAction { type: ActionTypes.GET_WEATHER_DATA; @@ -6,7 +7,7 @@ interface GetWeatherDataAction { interface GetWeatherDataSuccessAction { type: ActionTypes.GET_WEATHER_DATA_SUCCESS; - payload: string[]; + payload: WeatherDataset | null; } interface GetWeatherDataFailureAction { diff --git a/src/store/reducers/weatherReducer.ts b/src/store/reducers/weatherReducer.ts index e8ffef7..ffee846 100644 --- a/src/store/reducers/weatherReducer.ts +++ b/src/store/reducers/weatherReducer.ts @@ -1,15 +1,34 @@ import { ActionTypes } from "../action-types"; import { Action } from "../actions"; +export interface WeatherDataset { + consolidated_weather: { + id: number; + weather_state_name: string; + weather_state_abbr: string; + applicable_date: string; + min_temp: number; + max_temp: number; + the_temp: number; + wind_speed: number; + air_pressure: number; + humidity: number; + visibility: number; + }[]; + title: string; + woeid: number; + latt_long: string; +} + const initialState = { loading: false, - weatherData: [], + weatherData: null, error: null, }; interface WeatherState { loading: boolean; - weatherData: string[]; + weatherData: WeatherDataset | null; error: string | null; } @@ -21,7 +40,7 @@ const weatherReducer = ( case ActionTypes.GET_WEATHER_DATA: return { loading: true, - weatherData: [], + weatherData: null, error: null, }; case ActionTypes.GET_WEATHER_DATA_SUCCESS: @@ -34,7 +53,7 @@ const weatherReducer = ( return { loading: false, error: action.payload, - weatherData: [], + weatherData: null, }; default: return state;