Skip to content

Commit

Permalink
I changed the background image when the weather is cloudy by day.
Browse files Browse the repository at this point in the history
  • Loading branch information
aline-borges committed Nov 1, 2020
1 parent 952e047 commit 074d7d7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Binary file modified assets/images/weather/background/day/cloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/weather/background/night/cloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/async-storage": "~1.12.0",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^5.9.0",
"@react-navigation/native": "^5.7.4",
Expand Down
10 changes: 1 addition & 9 deletions src/screens/Location/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,13 @@ const Location = ({ route }) => {

let background = '';

if((time >= 7) && (time <= 16)){
if((time >= 6) && (time <= 17)){
if(weather === 'Clear') {return background = require('../../../assets/images/weather/background/day/default.png')}
if(weather === 'Clouds') {return background = require('../../../assets/images/weather/background/day/cloudy.png')}
if(weather === 'Rain') {return background = require('../../../assets/images/weather/background/day/rain.png')}
if(weather === 'Thunderstorm') {return background = require('../../../assets/images/weather/background/day/thunder.png')}
if(weather === 'Snow') {return background = require('../../../assets/images/weather/background/day/snowfall.png')}
}

if((time === 6)) {
return background = require('../../../assets/images/weather/background/sunrise.png');
}

if((time === 17)) {
return background = require('../../../assets/images/weather/background/sunset.png')
}

if((time >= 18) || (time <= 5)){
if(weather === 'Clear') {return background = require('../../../assets/images/weather/background/night/default.png')}
Expand Down
1 change: 1 addition & 0 deletions src/screens/Locations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
import { Feather } from '@expo/vector-icons';
//import AsyncStorage from '@react-native-async-storage/async-storage';
import { SafeAreaView } from 'react-native-safe-area-context';

const Locations = ({ navigation }) => {
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,13 @@
"@types/yargs" "^15.0.0"
chalk "^3.0.0"

"@react-native-community/async-storage@~1.12.0":
version "1.12.1"
resolved "https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.12.1.tgz#25f821b4f6b13abe005ad67e47c6f1cee9f27b24"
integrity sha512-70WGaH3PKYASi4BThuEEKMkyAgE9k7VytBqmgPRx3MzJx9/MkspwqJGmn3QLCgHLIFUgF1pit2mWICbRJ3T3lg==
dependencies:
deep-assign "^3.0.0"

"@react-native-community/cli-debugger-ui@^4.9.0":
version "4.9.0"
resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-4.9.0.tgz#4177764ba69243c97aa26829d59d9501acb2bd71"
Expand Down

0 comments on commit 074d7d7

Please sign in to comment.