-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
74 lines (65 loc) · 1.97 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
import React, { Component } from 'react';
import { Text, View, StyleSheet, Image } from 'react-native';
import { Constants } from 'expo';
// You can import from local files
import MyButton from './components/MyButton';
import MyTextInput from './components/MyTextInput';
import MyTextOutput from './components/MyTextOutput';
// or any pure javascript modules available in npm
// import { Card } from 'react-native-elements'; // Version can be specified in package.json
//containerStyle={{width: Dimensions.get('screen').width}, {height: Dimensions.get('screen').height}}
// var { Dimensions } = require('react-native')
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
textIn: 'Enter your query here.',
processedText: 'Your output will appear here.',
};
}
textI = textin => {
this.setState({ textIn: textin });
};
entered = () => {
this.setState({ processedText: this.state.textIn });
//actually do the proccessing
};
render() {
return (
<View style={styles.container}>
<Text style={styles.heading}>
CS + Social Good
</Text>
<Image source={require('./assets/Logo.png')} style={{flex:1, height: 100, width: 100}} resizeMode="contain" />
<Text style={styles.small}>
What would you like to know?
</Text>
<MyTextInput textInput={value => this.textI(value)} />
<MyButton bool={() => this.entered()} />
<MyTextOutput textOutput={this.state.processedText} />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#EAFAF1',
},
small: {
fontSize: 18,
marginBottom: 20,
color: '#21618C',
fontFamily: 'Times New Roman',
},
heading: {
fontSize: 32,
margin: 20,
color: '#21618C',
fontWeight: 'bold',
fontFamily: 'Roboto',
},
});