Skip to content

Commit 09d5433

Browse files
committed
add gif animation
1 parent 8ecab01 commit 09d5433

File tree

3 files changed

+122
-4
lines changed

3 files changed

+122
-4
lines changed

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
The main idea of this project is to show how can React Native interact with Google Maps API and Geolocation API.
44

5-
## React with Hooks
6-
7-
- react 16.8.6
8-
- react-native 0.60.3
5+
Type a location on the search box and the app will determine and trace the route on the google map.
6+
7+
8+
## Dependencies
9+
```json
10+
@react-native-community/geolocation: ^1.4.2
11+
react: 16.8.6
12+
react-native: 0.60.3
13+
react-native-geocoding: ^0.3.0
14+
react-native-gesture-handler: ^1.3.0
15+
react-native-google-places-autocomplete: ^1.3.9
16+
react-native-iphone-x-helper: ^1.2.1
17+
react-native-loading-spinner-overlay: ^1.0.1
18+
react-native-maps: ^0.25.0
19+
react-native-maps-directions: ^1.7.0
20+
react-native-paper: ^2.16.0
21+
react-native-vector-icons: ^6.6.0
22+
react-navigation: ^3.11.0
23+
react-redux: ^7.1.0
24+
redux: ^4.0.1
25+
redux-saga: ^1.0.5
26+
styled-components: ^4.3.1
27+
```
928

1029
---
1130

@@ -18,6 +37,11 @@ The main idea of this project is to show how can React Native interact with Goog
1837

1938
---
2039

40+
<p align="center">
41+
<img src="">
42+
</p>
43+
44+
2145
## License
2246

2347
This project is licensed under the MIT License.

src/demo/demoUber.gif

16.9 MB
Loading

src/navigation/index.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import React, { useEffect } from 'react';
2+
import { View } from 'react-native';
3+
import {
4+
createAppContainer,
5+
createStackNavigator,
6+
SafeAreaView,
7+
} from 'react-navigation';
8+
import { useDispatch, useSelector } from 'react-redux';
9+
import Loading from '~/components/Loading';
10+
import { startup } from '../../redux/actions/startupActions';
11+
import NavigationService from '../../services/NavigationService';
12+
import Colors from '../../Theme/Colors';
13+
import MainScreen from '~/containers/Main';
14+
import SplashScreen from '../SplashScreen/SplashScreen';
15+
16+
/**
17+
* a root screen contem a navegacao do app
18+
*
19+
* @see https://reactnavigation.org/docs/en/hello-react-navigation.html#creating-a-stack-navigator
20+
*/
21+
22+
// configuracao da Stack de navegacao
23+
// aplicas-se a todas as rotas
24+
const configureStack = {
25+
// Splash screen é exibida por default durante a execucao do startup() saga
26+
// ver definicao no arquivo StartupSaga.js
27+
initialRouteName: 'SplashScreen',
28+
// remove header de todas as telas
29+
// https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig
30+
headerMode: 'none',
31+
navigationOptions: {
32+
translucent: 'true',
33+
headerStyle: {
34+
backgroundColor: Colors.defaultBackground,
35+
elevation: 0,
36+
paddingTop: 40,
37+
},
38+
headerTitleStyle: {
39+
textAlign: 'center',
40+
fontFamily: 'Geomanist-Medium',
41+
alignSelf: 'center',
42+
},
43+
headerTintColor: Colors.headerTintColor,
44+
},
45+
};
46+
47+
/**
48+
* Root navigation
49+
*/
50+
const RootNavigator = createStackNavigator(
51+
{
52+
SplashScreen,
53+
MainScreen,
54+
},
55+
configureStack,
56+
);
57+
58+
/**
59+
* Configure App Container - for react-navigation 3+
60+
*/
61+
const AppContainer = createAppContainer(RootNavigator);
62+
63+
/**
64+
* Define main RootScreen component
65+
*/
66+
const RootScreen = () => {
67+
const { loading } = useSelector(state => state.api);
68+
const dispatch = useDispatch();
69+
70+
useEffect(() => {
71+
// Executa startup saga quando aplicacao inicia
72+
dispatch(startup());
73+
}, []);
74+
75+
return (
76+
<SafeAreaView
77+
style={{ flex: 1, backgroundColor: Colors.defaultBackground }}
78+
>
79+
<View style={{ flex: 1 }}>
80+
<Loading visible={loading} animation="fade" />
81+
<AppContainer
82+
// Utilizando NavigationService para permitir navegar de onde navigation props nao for acessível
83+
// Permite navegar direto de um Saga, por exemplo
84+
// NavigationService (https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html)
85+
ref={(navigatorRef) => {
86+
NavigationService.setTopLevelNavigator(navigatorRef);
87+
}}
88+
/>
89+
</View>
90+
</SafeAreaView>
91+
);
92+
};
93+
94+
export default RootScreen;

0 commit comments

Comments
 (0)