Location_initiate.js
4.31 KB
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
139
140
141
142
143
144
145
146
147
148
149
import React,{ Component } from 'react'
import {View,Text,RefreshControl,Image,ScrollView,Dimensions,TextInput,TouchableOpacity,StatusBar,StyleSheet} from 'react-native'
import { post, get, put, delete as remove } from 'axios'
import {AsyncStorage} from 'react-native'
import Modal from 'react-native-modal'
import SearchIcon from '../../assets/Search_icon.svg'
import FindPath from './FindPath'
import Postcode from '../Postcode'
class MainPage extends Component {
state = {
refreshing:false,
isModalVisible:false,
}
constructor(props) {
super(props)
}
_onRefresh = () => {
this.setState({refreshing: true});
this.setState({
refreshing:false,
})
}
componentDidMount() {
}
toggleModal = () => {
if(this.state.isModalVisible == true) {
this.setState({
isModalVisible:false
})
}
else {
this.setState({
isModalVisible:true
})
}
}
GotoMap = () => {
AsyncStorage.setItem('isFirst',JSON.stringify({isFirst:true}))
this.props.navigation.navigate("GoogleMap")
}
render() {
return (
<View style={{height:"100%",width:"100%",backgroundColor:"white",paddingTop:"10%",paddingLeft:"10%",paddingRight:"10%"}}>
<Text style={{fontSize:14,textAlign:"center",color:"black"}}>도로명, 건물명, 읍/면/동/리를 입력하세요</Text>
<View style={{}}>
<TouchableOpacity onPress={() => this.toggleModal()} style={{paddingTop:9,paddingBottom:9,borderColor:"#FFD63A",flexDirection:"row",alignSelf:"center",justifyContent:"space-between",marginTop:16,borderWidth:1,width:"80%",paddingLeft:10}}>
<Text>
예) 판교역로 235, 분당 주공, 삼평동
</Text>
<SearchIcon style={{alignSelf:"center",marginRight:15}}/>
</TouchableOpacity>
</View>
<TouchableOpacity onPress={() => this.GotoMap()} style={{alignSelf:"center", fontSize:14,marginTop:16,fontWeight:"bold"}}>
<Text style={{alignSelf:"center", fontSize:10,marginTop:16,fontWeight:"bold"}}>
현 위치로 주소설정
</Text>
</TouchableOpacity>
<Modal onBackButtonPress={() => this.setState({isModalVisible:false})} onBackdropPress={() => this.setState({isModalVisible:false})} isVisible={this.state.isModalVisible}>
<View style={{width:"100%",height:"100%"}}>
<Postcode
jsOptions={{ animated: true }}
onSelected={(data) => {
this.toggleModal()
this.props.navigation.navigate("GoogleMap",{address:data.address})
}}
/>
</View>
</Modal>
</View>
)
}
}
const style=StyleSheet.create({
list_pick_event: {
paddingTop:17,
paddingBottom:17,
borderBottomColor:"#BBB9B9",
borderTopColor:"#BBB9B9",
borderBottomWidth:0.5,
},
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
avatar : {
width:32,
height:32,
borderRadius:100,
},
detail: {
marginLeft:15,
flex:1,
flexDirection:"row",
},
hit: {
fontSize:9,
fontWeight:"bold"
},
date: {
marginLeft:9,
fontSize:9,
color:"black"
},
userWrapper : {
flex:1,
flexDirection:"row",
paddingTop:13,
paddingBottom:17,
borderBottomColor:"#AEAEAE",
borderBottomWidth:1,
},
nickname : {
marginLeft:10,
fontSize:13,
fontWeight:"bold",
color:"black"
},
title : {
fontSize:13,
fontWeight:"bold",
color:"black"
},
like : {
marginTop:3,
fontSize:10,
color:"red",
marginLeft:5,
},
titleWrapper : {
marginTop:17,
paddingLeft:19,
flex:1,
flexDirection:"row"
}
})
export default MainPage