-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.js
More file actions
29 lines (26 loc) · 726 Bytes
/
App.js
File metadata and controls
29 lines (26 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import useWeather from './library/customHooks/useWeatherData';
import Loading from './components/Loading/Loading';
import Weather from './components/Weather/Weather';
import { View, StyleSheet } from 'react-native';
export default function App() {
const { weather, city, airPollution } = useWeather();
// console.log(city);
return (
<View style={styles.container}>
{!weather || !city || !airPollution ? (
<Loading />
) : (
<Weather weather={weather} city={city} airPollution={airPollution} />
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
//justifyContent: 'center',
//alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.6)',
},
});