-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
47 lines (46 loc) · 1.11 KB
/
main.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
import React from 'react';
import { StyleSheet, Text, View, StatusBar } from 'react-native';
import { LinearGradient } from 'expo';
import { primaryGradientArray } from './utils/colors';
import Header from './components/header';
import Input from './components/input';
const headerTitle = 'To Do';
export default class Main extends React.Component {
state = {
inputValue: ''
};
newInputValue = value => {
this.setState({
inputValue: value
});
};
render() {
const { inputValue } = this.state;
return (
<LinearGradient
colors={primaryGradientArray}
style={styles.container}
>
<StatusBar barStyle="light-content" />
<View style={styles.centered}>
<Header title={headerTitle} />
</View>
<View style={styles.inputContainer}>
<Input inputValue={inputValue} onChangeText={this.newInputValue} />
</View>
</LinearGradient>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1
},
centered: {
alignItems: 'center'
},
inputContainer: {
marginTop: 40,
paddingLeft: 15
}
});