|
@@ -1,8 +1,10 @@
|
|
|
-import React from 'react';
|
|
|
-
|
|
|
+import React, {useState, useEffect} from 'react';
|
|
|
+import {Alert} from 'react-native';
|
|
|
+import Auth ,{LM} from '../provider/Auth'
|
|
|
import i18n from "i18n-js";
|
|
|
|
|
|
import C from 'rn-class'
|
|
|
+import _ from 'lodash'
|
|
|
import AsyncStorage from '@react-native-community/async-storage';
|
|
|
|
|
|
C.addColor("#03cf5d", "color-naver");
|
|
@@ -14,12 +16,28 @@ C.addColor("#c87320" , "color-not_agreeBtn");
|
|
|
export default (props)=>{
|
|
|
// 다국어 처리 영역
|
|
|
let {termsTitle, agree , not_agree} = i18n.t("AcceptTerms");
|
|
|
-
|
|
|
- const agreeNoagree = () => {
|
|
|
+ //변수선언 영역
|
|
|
+ let [accptArr , setAccptArr ] = useState([]);
|
|
|
+ useEffect(()=>{
|
|
|
+ termsTitle.map(()=>{
|
|
|
+ accptArr.push(false);
|
|
|
+ })
|
|
|
+ },[]);
|
|
|
+
|
|
|
+ let onAccpt = (idx)=>{
|
|
|
+ accptArr[idx] = !accptArr[idx]
|
|
|
+ setAccptArr(_.map(accptArr))
|
|
|
+ }
|
|
|
+ const agreeAgree = () => {
|
|
|
props.navigation.navigate('Guide1');
|
|
|
}
|
|
|
+ const agreeNoagree = async () => {
|
|
|
+ await LM.logout();
|
|
|
+ Alert.alert("모든 약관에 동의 하셔야 이용이 가능합니다.");
|
|
|
+ props.navigation.navigate('Login');
|
|
|
+ }
|
|
|
|
|
|
- return (
|
|
|
+ return (
|
|
|
<C.View cls="flx1 bgc-color-white">
|
|
|
<C.Comp.Header {...props}/>
|
|
|
{/* body */}
|
|
@@ -44,9 +62,10 @@ export default (props)=>{
|
|
|
name="popup"
|
|
|
type="entypo"
|
|
|
color="white"
|
|
|
+
|
|
|
/>
|
|
|
}/>
|
|
|
- <C.EL.CheckBox title='동의합니다' ccls="bgc-color-transparent bw0"/>
|
|
|
+ <C.EL.CheckBox title='동의합니다' ccls="bgc-color-transparent bw0" checked={accptArr[idx]} onPress={onAccpt.bind(this, idx)}/>
|
|
|
</C.View>
|
|
|
|
|
|
)
|
|
@@ -54,7 +73,7 @@ export default (props)=>{
|
|
|
}
|
|
|
</C.View>
|
|
|
<C.View cls="flx0.2 ai-c w100% flx-row jc-c">
|
|
|
- <C.EL.Button onPress={agreeNoagree} title={agree} ccls="w40% mr3" btncls="bgc-color-agreeBtn"/>
|
|
|
+ <C.EL.Button onPress={ agreeAgree} title={agree} ccls="w40% mr3" btncls="bgc-color-agreeBtn"/>
|
|
|
<C.EL.Button onPress={agreeNoagree} title={not_agree} ccls="w40%" btncls="bgc-color-not_agreeBtn"/>
|
|
|
</C.View>
|
|
|
|