-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
85 lines (82 loc) · 2.03 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
KeyboardAvoidingView,
Image,
ImageBackground,
} from 'react-native';
import Form from './app/components/Form';
/*
<ImageBackground style={styles.container} source={require('./app/img/bg.jpg')}>
<Text style={styles.header}>eatplus</Text>
<Form />
</ImageBackground>
*/
export default class App extends Component<Props> {
state = {
isLoggedIn: false
}
render() {
if (this.state.isLoggedIn)
return (
<View>
<Text>Welcome to eatplus.</Text>
</View>
);
else
return (
<KeyboardAvoidingView behavior='padding' style={styles.wrapper}>
<Text style={styles.header}>eatplus</Text>
<View style={styles.container}>
<Form onLoginPress={()=>this.setState({isLoggedIn: true})}/>
<View style={styles.dummy}></View>
</View>
</KeyboardAvoidingView>
);
}
}
const styles = StyleSheet.create({
wrapper: {
flex: 1,
alignItems: 'center',
marginTop: 0,
marginBottom: 18,
marginRight: 35,
marginLeft: 35,
},
container: {
flex: 1,
alignSelf: 'stretch',
width: null,
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'column',
backgroundColor: '#f7941d',
paddingTop: 18,
paddingBottom: 14,
paddingRight: 25,
paddingLeft: 25,
borderRadius: 10,
},
header: {
fontSize: 85,
color: '#f7941d',
fontWeight: 'bold',
},
dummy: {
alignSelf: 'stretch',
backgroundColor: '#fab767',
borderRadius: 30,
marginTop: 12,
marginLeft: 25,
marginRight: 25,
height: 77,
}
});