-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlander.js
73 lines (71 loc) · 3.01 KB
/
lander.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
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from 'react';
import { StyleSheet, Text, View, TextInput } from 'react-native';
import { FormLabel, FormInput, Button } from 'react-native-elements';
import config from './config.js';
import { Login } from './login';
import { Signup } from './signup';
import {
AuthenticationDetails,
CognitoUser,
CognitoUserAttribute,
CognitoUserPool
} from './lib/aws-cognito-identity';
export class Lander extends React.Component {
constructor(props) {
super(props);
console.log('userToken lander', this.props.userToken)
}
render() {
return (
<View>
{!this.props.userToken ?
<View>
<Button
raised
icon={{name: 'home', size: 32}}
buttonStyle={{backgroundColor: 'red', borderRadius: 10, margin: 10}}
onPress={() => this.props.navigation.navigate('Login')}
textStyle={{textAlign: 'center'}}
title={`Login`}
/>
< Button
raised
icon={{name: 'home', size: 32}}
buttonStyle={{backgroundColor: 'red', borderRadius: 10, margin: 10}}
onPress={() => this.props.navigation.navigate('Signup')}
textStyle={{textAlign: 'center'}}
title={`Signup`}
/>
</View>
:
<View>
<Button
raised
icon={{name: 'home', size: 32}}
buttonStyle={{backgroundColor: 'red', borderRadius: 10, margin: 10}}
onPress={() => this.props.navigation.navigate('Movies')}
textStyle={{textAlign: 'center'}}
title={`Proceed`}
/>
< Button
raised
icon={{name: 'home', size: 32}}
buttonStyle={{backgroundColor: 'red', borderRadius: 10, margin: 10}}
onPress={() => this.props.navigation.navigate('Recommendations')}
textStyle={{textAlign: 'center'}}
title={`Recommendations`}
/>
<Button
raised
icon={{name: 'home', size: 32}}
buttonStyle={{backgroundColor: 'red', borderRadius: 10, margin: 10}}
onPress={() => this.props.navigation.navigate('WatchList')}
textStyle={{textAlign: 'center'}}
title={`Watch List`}
/>
</View>
}
</View>
)
}
}