-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
62 lines (52 loc) · 1.32 KB
/
App.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Amplify from 'aws-amplify';
import { AmplifyTheme } from 'aws-amplify-react-native';
import config from './aws-exports';
import Main from './Function/main';
import {
Authenticator,
SignIn,
ConfirmSignIn,
ForgotPassword
} from 'aws-amplify-react-native/dist/Auth';
import SignUp from './Components/SignUp';
import ConfirmSignUp from './Components/ConfirmSignUp'
function Home(props){
if(props.authState==='signedIn')
return <Main/>;
else return <></>
}
// import { withAuthenticator } from 'aws-amplify-react-native';
Amplify.configure({
...config,
Analytics: {
disabled: true,
},
});
export default function App() {
return (
<View style={styles.container}>
<Authenticator
usernameAttributes="email"
hideDefault={true}
onStateChange={authState=> console.log("authState...",authState)}>
<Home/>
<SignUp/>
<SignIn/>
<ConfirmSignUp/>
<ConfirmSignIn/>
<ForgotPassword/>
</Authenticator>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex:1,
alignItems: 'center',
justifyContent: 'center',
},
});