Skip to content

Commit 94ce801

Browse files
committed
Record Demo to READ.ME
1 parent f6dfc54 commit 94ce801

File tree

7 files changed

+16
-7
lines changed

7 files changed

+16
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<img src="src/assets/demo/sample1.gif" alt="React Native Best Practice" width="150"/>
2+
13
1. react-navigation
24

35
- https://reactnavigation.org/docs/en/getting-started.html

src/assets/demo/sample1.gif

24.7 MB
Loading

src/navigation/AuthLoadingNavigator.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React, {useEffect, useContext} from 'react';
2-
import {StyleSheet, View, StatusBar, Image} from 'react-native';
2+
import {StyleSheet, View, StatusBar} from 'react-native';
33
import * as firebase from 'firebase';
4+
import {useNavigation} from '@react-navigation/native';
45

56
import Loading from '../components/Loading';
67

78
// import {CTX} from '../tools/context';
89

910
export default function AuthLoadingScreen(props) {
10-
const {navigation} = props;
11+
const navigation = useNavigation();
1112
const {navigate} = navigation;
1213

1314
// const authContext = useContext(CTX);
@@ -18,9 +19,12 @@ export default function AuthLoadingScreen(props) {
1819
}, []);
1920

2021
function _bootstrapAsync() {
22+
// NOTE: firebase
2123
firebase.auth().onAuthStateChanged(user => {
2224
navigate(user ? 'Dashboard' : 'Auth');
2325
});
26+
27+
// NOTE: context
2428
// navigate(token ? 'Dashboard' : 'Auth');
2529
}
2630

src/screens/Forgot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import {
88
} from 'react-native';
99
import {Formik} from 'formik';
1010
import SafeAreaView from 'react-native-safe-area-view';
11+
import {useNavigation} from '@react-navigation/native';
1112

1213
import ForgotSchema from '../validation/Forgot';
1314
import {primaryColor} from '../theme';
1415

15-
export default function ForgotScreen(props) {
16-
const {navigation} = props;
16+
export default function ForgotScreen() {
17+
const navigation = useNavigation();
1718
const {navigate} = navigation;
1819

1920
function _onSend() {

src/screens/Login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {primaryColor} from '../theme';
2020
import LoadingScreen from '../components/Loading';
2121

2222
export default function LoginScreen() {
23-
const navigation = useNavigation;
23+
const navigation = useNavigation();
2424
const {navigate} = navigation;
2525

2626
const [loading, setLoading] = useState(false);

src/screens/Register.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import {Formik} from 'formik';
1010
import SafeAreaView from 'react-native-safe-area-view';
1111
// import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
1212
import firebase from 'firebase';
13+
import {useNavigation} from '@react-navigation/native';
1314

1415
import RegisterSchema from '../validation/Register';
1516
import {primaryColor} from '../theme';
1617

1718
export default function RegisterScreen(props) {
18-
const {navigation} = props;
19+
const navigation = useNavigation();
1920
const {navigate} = navigation;
2021

2122
const [errorMessage, setErrorMessage] = useState('');

src/tools/context/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export default function Store(props) {
2626

2727
const _logout = async () => {
2828
// await AsyncStorage.removeItem('userToken');
29-
await AsyncStorage.clear();
29+
await AsyncStorage.removeItem('userSkip');
30+
// await AsyncStorage.clear();
3031
};
3132

3233
const _seen = async () => {

0 commit comments

Comments
 (0)