import React, {useState, useEffect} from 'react'; import {View, StyleSheet, ScrollView, Text, Alert} from 'react-native'; import Button from '../component/Button'; import Checkbox from '../component/Checkbox'; import { container, pageTitleBox, pageTitle, } from '../resoureces/styles/GlobalStyles'; import {PERSONAL_INFORMATION, LOCATION, NAVIGATION} from '../../Global'; import {ScrollView as GestureHandlerScrollView} from 'react-native-gesture-handler'; import {PRIMARY, WHITE} from '../color'; export default function Agreement({navigation}) { const [allCheck, setAllCheck] = useState(false); const [naviCheck, setNaviCheck] = useState(false); const [useCheck, setUseCheck] = useState(false); const [infoCheck, setInfoCheck] = useState(false); const allBtnEvent = () => { if (allCheck === false) { setAllCheck(true); setNaviCheck(true); setUseCheck(true); setInfoCheck(true); } else { setAllCheck(false); setNaviCheck(false); setUseCheck(false); setInfoCheck(false); } }; const naviBtnEvent = () => { if (naviCheck === false) { setNaviCheck(true); } else { setNaviCheck(false); } }; const useBtnEvent = () => { if (useCheck === false) { setUseCheck(true); } else { setUseCheck(false); } }; const infoBtnEvent = () => { if (infoCheck === false) { setInfoCheck(true); } else { setInfoCheck(false); } }; const allCheckList = () => { if (allCheck) { navigation.navigate('JoinMembers'); } else { Alert.alert( '약관에 동의해주세요.', `네비게이션 이용약관, 개인정보 수집 및 이용동의, 위치정보 이용약관에 모두 동의해주세요`, ); } }; useEffect(() => { if (naviCheck === true && useCheck === true && infoCheck === true) { setAllCheck(true); } else { setAllCheck(false); } }, [naviCheck, useCheck, infoCheck]); return ( 이용 약관 {NAVIGATION} {PERSONAL_INFORMATION} {LOCATION}