Skip to content

Commit 2bb5371

Browse files
committed
v0.4 stable release - weather backgrounds
1 parent 5971f5b commit 2bb5371

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/components/weather/DayComponent.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import getWeatherIcon from '../../utils/WeatherIcon'
55
import FormatTime from './../../utils/FormatTime'
66
import {PropTypes} from 'prop-types'
77
import WeatherIconComponent from './WeatherIconComponent'
8+
import {ThemeContext} from '../../context/ThemeContext'
89

910
const DayComponent = props => {
1011
const {day, index, selectedIndex} = props
1112
const {weatherUnit} = useContext(WeatherUnitContext)
13+
const {theme, colorTheme} = useContext(ThemeContext)
1214

1315
/**
1416
* type can be 'High' or 'Low'
@@ -26,8 +28,8 @@ const DayComponent = props => {
2628

2729
return (
2830
<div
29-
className={`sm:border-t sm:border-r sm:border-b-0 sm:border-l-0 sm:border-light sm:hover:bg-light sm:hover:text-black items-center text-center sm:flex-1 sm:py-1 sm:pb-3 cursor-pointer ${
30-
index === selectedIndex ? `bg-light text-black` : ''
31+
className={`sm:border-t sm:border-r sm:border-b-0 sm:border-l-0 md:border-light md:hover:bg-light md:hover:text-black items-center text-center sm:flex-1 sm:py-1 sm:pb-3 cursor-pointer ${
32+
index === selectedIndex ? `bg-${colorTheme} text-${theme}` : ''
3133
} transition-all duration-1000 ease-in-out`}
3234
onClick={selectedDay}>
3335
<div className='flex flex-row flex-no-wrap sm:flex-col sm:flex-wrap justify-around items-center px-2'>

src/components/weather/TimeframeComponent.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import getWeatherIcon from '../../utils/WeatherIcon'
55
import FormatTime from './../../utils/FormatTime'
66
import {PropTypes} from 'prop-types'
77
import WeatherIconComponent from './WeatherIconComponent'
8+
import {ThemeContext} from '../../context/ThemeContext'
89

910
const TimeframeComponent = ({Timeframe}) => {
1011
const {weatherUnit} = useContext(WeatherUnitContext)
12+
const {colorTheme} = useContext(ThemeContext)
1113

1214
/**
1315
* type can be `temperature` or `apparentTemperature`
@@ -20,7 +22,8 @@ const TimeframeComponent = ({Timeframe}) => {
2022
}
2123

2224
return (
23-
<div className='border-none flex flex-col justify-start items-center mx-3 mb-3 w-full font-light text-light'>
25+
<div
26+
className={`border-none flex flex-col justify-start items-center mx-3 mb-3 w-full font-light text-${colorTheme} md:text-light`}>
2427
<div>
2528
{getWeatherIcon(Timeframe).startsWith('wi') ? (
2629
<p className='text-5xl mt-4' title={Timeframe.summary}>

src/containers/weather/WeatherContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const WeatherContainer = () => {
9494
'flex flex-col justify-center items-center lg:px-5 pt-10'
9595
}>
9696
<div
97-
className={`sm:w-full lg:w-5/6 xl:max-w-6xl bg-${theme} text-${colorTheme} rounded-t-2xl shadow-lg`}>
97+
className={`sm:w-full lg:w-5/6 xl:max-w-6xl bg-${theme} text-${colorTheme} border border-${colorTheme} md:border-none rounded-t-2xl shadow-lg`}>
9898
<div className='relative'>
9999
<img
100100
src={`./weather-backgrounds/${getWeatherBackground(

0 commit comments

Comments
 (0)