Commit fd4ec96a authored by Trisno's avatar Trisno

fix bug tambah alamat

parent a76096d8
...@@ -225,5 +225,7 @@ ...@@ -225,5 +225,7 @@
"headerPrivacyPolicy": "Privacy Policy", "headerPrivacyPolicy": "Privacy Policy",
"alertTokenResetPassword": "Please insert token", "alertTokenResetPassword": "Please insert token",
"alertNewPassword": "Please insert new password", "alertNewPassword": "Please insert new password",
"alerConfirmNewPassword": "Please insert confirm password" "alerConfirmNewPassword": "Please insert confirm password",
"alertLabelAddress": "Please insert label address",
"alertDetailAddress": "Please insert detail address"
} }
\ No newline at end of file
...@@ -225,5 +225,7 @@ ...@@ -225,5 +225,7 @@
"headerPrivacyPolicy":"Kebijakan Privasi", "headerPrivacyPolicy":"Kebijakan Privasi",
"alertTokenResetPassword":"Silahkan masukan token", "alertTokenResetPassword":"Silahkan masukan token",
"alertNewPassword": "Silahkan masukan password baru", "alertNewPassword": "Silahkan masukan password baru",
"alerConfirmNewPassword": "Silahkan masukan konfirmasi password baru" "alerConfirmNewPassword": "Silahkan masukan konfirmasi password baru",
"alertLabelAddress": "Silahkan masukan nama alamat",
"alertDetailAddress": "Silahkan masukan detail alamat"
} }
\ No newline at end of file
...@@ -172,6 +172,16 @@ class AddreesDetail extends React.Component { ...@@ -172,6 +172,16 @@ class AddreesDetail extends React.Component {
// console.log('LATITUDE' + '' + this.state.latitude + '' + 'LONGITUDE' + this.state.longitude) // console.log('LATITUDE' + '' + this.state.latitude + '' + 'LONGITUDE' + this.state.longitude)
} }
validation(){
if (this.state.name == '') {
Alert.alert(i18n.t('alertLabelAddress'))
} else if (this.state.description == ''){
Alert.alert(i18n.t('alertDetailAddress'))
} else {
this.saveAddress()
}
}
saveAddress() { saveAddress() {
this.setState({ this.setState({
...@@ -315,11 +325,20 @@ class AddreesDetail extends React.Component { ...@@ -315,11 +325,20 @@ class AddreesDetail extends React.Component {
onFocus={() => this.setState({ caretHidden: false })} /> onFocus={() => this.setState({ caretHidden: false })} />
</View> </View>
<View style={{ margin: 50, justifyContent: 'center' }}> <View style={{ margin: 50, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.saveAddress()}> {
this.state.indicator == true ? (
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#838383', justifyContent: 'center' }}>
<ActivityIndicator size="large" color="#c9af6d" />
</View>
) : (
<TouchableOpacity onPress={() => this.validation()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('addaddress')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('addaddress')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
)
}
</View> </View>
<View style={{ height: 20 }}></View> <View style={{ height: 20 }}></View>
</View> </View>
......
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