Skip to content

Commit 617bb17

Browse files
committed
rn-weather
1 parent c87a488 commit 617bb17

File tree

13 files changed

+10755
-72
lines changed

13 files changed

+10755
-72
lines changed

.idea/workspace.xml

Lines changed: 87 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rn-weather/.expo-shared/assets.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
3+
"89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
4+
}

rn-weather/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules/**/*
2+
.expo/*
3+
npm-debug.*
4+
*.jks
5+
*.p8
6+
*.p12
7+
*.key
8+
*.mobileprovision
9+
*.orig.*
10+
web-build/
11+
web-report/

rn-weather/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

rn-weather/App.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import { StyleSheet, Text, View, Alert } from 'react-native';
3+
import Loading from './Loading'
4+
import * as Location from 'expo-location';
5+
6+
export default class App extends React.Component{
7+
getLocation = async() => {
8+
try{
9+
await Location.requestPermissionsAsync();
10+
const location = await Location.getCurrentPositionAsync();
11+
console.log(location);
12+
}catch(e){
13+
Alert.alert('Can\'t find you', 'So sad');
14+
}
15+
}
16+
componentDidMount() {
17+
this.getLocation();
18+
}
19+
render() {
20+
return <Loading />
21+
}
22+
}

rn-weather/Loading.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react';
2+
import {StyleSheet, Text, View} from 'react-native';
3+
4+
export default function Loading(){
5+
return (<View style={styles.container}>
6+
<Text>Getting the weather</Text>
7+
</View>);
8+
}
9+
const styles = StyleSheet.create({
10+
container : {
11+
flex : 1,
12+
justifyContent : 'flex-end',
13+
paddingHorizontal : 30,
14+
paddingVertical:100,
15+
backgroundColor : "#FDF6AA"
16+
},
17+
text : {
18+
color : "#2c2c2c",
19+
fontSize : 20
20+
}
21+
});

rn-weather/app.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expo": {
3+
"name": "weather app",
4+
"slug": "rn-weather",
5+
"privacy": "public",
6+
"sdkVersion": "35.0.0",
7+
"platforms": [
8+
"ios",
9+
"android",
10+
"web"
11+
],
12+
"version": "1.0.0",
13+
"orientation": "portrait",
14+
"icon": "./assets/icon.png",
15+
"splash": {
16+
"image": "./assets/splash.png",
17+
"resizeMode": "contain",
18+
"backgroundColor": "#ffffff"
19+
},
20+
"updates": {
21+
"fallbackToCacheTimeout": 0
22+
},
23+
"assetBundlePatterns": [
24+
"**/*"
25+
],
26+
"ios": {
27+
"supportsTablet": true
28+
}
29+
}
30+
}

rn-weather/assets/icon.png

1.07 KB
Loading

rn-weather/assets/splash.png

7.01 KB
Loading

rn-weather/babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function(api) {
2+
api.cache(true);
3+
return {
4+
presets: ['babel-preset-expo'],
5+
};
6+
};

0 commit comments

Comments
 (0)