-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHomePage.js
138 lines (115 loc) · 2.83 KB
/
HomePage.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View, Image, TextInput, Dimensions } from 'react-native';
import { createRouter, NavigationProvider, StackNavigation } from '@exponent/ex-navigation';
import Button from 'react-native-button';
import Router from './Router';
// import MapPage from './MapPage';
export default class HomePage extends Component {
static route = {
title: 'home',
}
constructor(props) {
super(props);
this.state = {
value:''
}
}
goToTest() {
if (this.state.value === '' || this.state.value === null || this.state.value === 'undefined'){
alert('ID Not Valid');
}
//pushes to map page and renders the inputted value
this.props.navigator.push(Router.getRoute('test',{id: this.state.value}));
}
render() {
return(
<View style={styles.mainContainer}>
<View style={styles.viewStyling}>
<Image className="LandingImg"
source={require('./helpingsketch.jpg')}
style={styles.landingImg}
/>
<Text style={styles.logoStyling}>Diagnosed?</Text>
<Text style={styles.sloganStyling}>get a second opinion</Text>
</View>
<View style={styles.searchDisease}>
<TextInput
style={styles.textInput}
placeholder='ex. Lung...'
onChangeText={(value) => this.setState({value})}
value={this.state.value}
/>
</View>
<View style={styles.goButton}>
<Button
style={styles.buttonStyling}
styleDisabled={{color: 'red'}}
onPress={this.goToTest.bind(this)}>Go
</Button>
</View>
</View>
)
}
}
const styles = StyleSheet.create({
mainContainer: {
flexDirection:'column'
},
viewStyling: {
alignItems:'center',
flexDirection:'column'
},
logoStyling: {
backgroundColor:'transparent',
marginTop:30,
fontSize:32,
color:'#E2E2E2',
fontWeight: '300'
},
sloganStyling: {
backgroundColor:'transparent',
fontSize:18,
marginTop:10,
color: '#E2E2E2',
fontWeight: '300'
},
landingImg: {
position:'absolute',
height:700
},
searchDisease: {
flexDirection:'row',
marginTop: 50,
justifyContent:'center',
backgroundColor:'transparent'
},
textInput: {
height:40,
borderRadius: 5,
width:170,
textAlign: 'center',
backgroundColor:'#F0F0F0',
},
goButton: {
alignSelf:'center',
marginTop:200,
// marginLeft:150,
backgroundColor:'transparent',
width:70,
height:70,
},
buttonStyling: {
position:'relative',
textAlign:'center',
fontSize:32,
color:'white',
borderRadius: 5,
fontWeight: '200',
borderWidth:1,
borderColor:'white',
width:80,
height:60,
padding:10
// width:100
}
});