AuthCheck.js
3.73 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
import React,{ Component } from 'react'
import {View,Text,RefreshControl,Image,ScrollView,Dimensions,TextInput,TouchableOpacity,StatusBar,StyleSheet,TouchableHighlight} from 'react-native'
import CheckBox from '@react-native-community/checkbox'
import { post, get, put, delete as remove } from 'axios'
class AuthCheck extends Component {
state = {
location:false,
marketing:false,
}
constructor(props) {
super(props)
}
componentDidMount() {
}
onChangeLocationAuth=()=> {
if(this.state.location == false) {
this.setState({
location:true
})
}
else {
this.setState({
location:false
})
}
}
onChangeMarketingAuth=()=> {
if(this.state.marketing == false) {
this.setState({
marketing:true
})
}
else {
this.setState({
marketing:false
})
}
}
onStartApp = () => {
if(this.state.location === false) return alert('위치 기반 서비스 약관에 동의하셔야 합니다.')
this.props.navigation.replace("Location_initiate",null)
}
render() {
return (
<View style={{height:"100%",width:"100%",backgroundColor:"white"}}>
<View style={{backgroundColor:"white", paddingLeft:"5%",paddingRight:"5%", paddingTop:"10%"}}>
<Text style={style.Title}>소비자와</Text>
<Text style={style.Title}>소상공인을</Text>
<Text style={style.Title}>위한 상가톡-</Text>
<View style={{marginTop:30}}>
<Text style={{fontSize:25}}>
아래 약관에 동의하시면
</Text>
<Text style={{fontSize:25}}>
다양한 서비스를 이용하실 수 있습니다.
</Text>
</View>
<View style={{marginTop:30}}>
<View style={{display:"flex",flexDirection:"row",justifyContent:"space-between"}}>
<Text style={{fontSize:14,marginBottom:10}}>
위치 기반 서비스 약관 동의(필수)
</Text>
<CheckBox onChange={this.onChangeLocationAuth} value = {this.state.location} tintColors={{true:'#f4cd37'}} style={{marginTop:-5}}/>
</View>
<View style={{display:"flex",flexDirection:"row",justifyContent:"space-between"}}>
<Text style={{fontSize:14}}>
마케팅 정보 앱 푸시 알림 수신 동의(선택)
</Text>
<CheckBox onChange={this.onChangeMarketingAuth} value = {this.state.marketing} tintColors={{true:'#f4cd37'}} style={{marginTop:-5}}/>
</View>
</View>
</View>
<View style={{display:"flex",flexDirection:"row",position:"absolute",bottom:0}}>
<TouchableOpacity onPress={() => this.setState({marketing:true,location:true})} style={{flex:1,backgroundColor:"#f4cd37",padding:10}}>
<Text style={{textAlign:"center",fontSize:18,color:"white"}}>
전체동의
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.onStartApp()} style={{flex:1,padding:10}}>
<Text style={{textAlign:"center",fontSize:18}}>
시작하기
</Text>
</TouchableOpacity>
</View>
</View>
)
}
}
const style=StyleSheet.create({
Title:{
fontSize:50
},
})
export default AuthCheck