You need to sign in or sign up before continuing.
Commit 685c919a authored by Afid's avatar Afid

adding checkbox accept service guide rule and privacy policy (terms and condition)

parent 7f7152ea
{
"expo": {
"extra" : {
"buildNumber" : "178",
"buildNumber" : "179",
"remarks": ""
},
......
......@@ -244,5 +244,6 @@
"headerAddressDetail": "ADD ADDRESS",
"headerEditAddress": "EDIT ADDRESS",
"track":"TRACK"
"track":"TRACK",
"accept_terms_condition": "Accept Service Guide Rules and Privacy Policy"
}
\ No newline at end of file
......@@ -243,5 +243,7 @@
"headerAddressDetail": "TAMBAH ALAMAT",
"headerEditAddress": "EDIT ALAMAT",
"track":"LACAK"
"track":"LACAK",
"accept_terms_condition": "Menyetujui Panduan Layanan dan Kebijakan Privasi"
}
\ No newline at end of file
import React from 'react';
import { StyleSheet, View, Text, TextInput, Button, StatusBar, Picker, Alert, Image, Platform } from 'react-native';
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { ListItem, CheckBox, Body } from 'native-base';
import { ScrollView, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler';
import Axios from 'axios';
import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType';
......@@ -34,15 +35,15 @@ class NewRegister extends React.Component {
constructor(props) {
super(props);
this.state = ({
dateAndroid : [
dateAndroid: [
i18n.t('pilih'), "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"
],
monthAndroid : [
monthAndroid: [
i18n.t('pilih'), "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September",
"Oktober", "November", "Desember"
],
yearAndroid : [
yearAndroid: [
i18n.t('pilih'), "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970", "1971",
"1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983", "1984", "1985", "1986", "1987",
"1988", "1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004",
......@@ -68,6 +69,7 @@ class NewRegister extends React.Component {
selected_item: [],
language: 'id',
spinner: false,
terms_condition: false
})
}
......@@ -285,6 +287,11 @@ class NewRegister extends React.Component {
);
})
}
checkboxPressed() {
this.setState({ terms_condition: !this.state.terms_condition });
}
render() {
return (
<View style={styles.container}>
......@@ -476,11 +483,30 @@ class NewRegister extends React.Component {
</View>
)}
</View>
<TouchableOpacity onPress={() => this.validate()}>
<View style={styles.button}>
<View style={styles.itemsRow}>
<View style={styles.items4}>
<ListItem style={{ borderBottomColor: 'white', alignItems: 'center', alignContent: 'center' }}>
<CheckBox color="#CFB368" checked={this.state.terms_condition} onPress={() => this.checkboxPressed()} />
<Body>
<TouchableWithoutFeedback onPress={() => this.props.navigation.navigate('Privacy Statement')}>
<Text style={{ marginLeft: 16, color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('accept_terms_condition')}</Text>
</TouchableWithoutFeedback>
</Body>
</ListItem>
</View>
</View>
{this.state.terms_condition ? (
<TouchableOpacity onPress={() => this.validate()}>
<View style={styles.button}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 22 }}>{i18n.t('register')}</Text>
</View>
</TouchableOpacity>
) : (
<View style={styles.buttonDisabled}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 22 }}>{i18n.t('register')}</Text>
</View>
</TouchableOpacity>
)}
<TouchableOpacity onPress={() => this.props.navigation.navigate('Login')}>
<View style={styles.signin}>
<Text style={{ color: '#CFB368' }}>{i18n.t('login')}</Text>
......@@ -535,6 +561,13 @@ const styles = StyleSheet.create({
alignItems: 'stretch',
borderWidth: 1
},
items4: {
flex: 1,
height: 40,
marginHorizontal: 26,
justifyContent: 'center',
alignItems: 'stretch',
},
itemPicker: {
flexDirection: 'row',
flex: 1,
......@@ -582,6 +615,15 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center'
},
buttonDisabled: {
backgroundColor: '#e3e3e3',
marginTop: 25,
marginHorizontal: 100,
borderRadius: 15,
paddingVertical: 5,
alignItems: 'center',
justifyContent: 'center'
},
signin: {
marginTop: 25,
alignItems: 'center',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment