diff --git a/src/components/Input/DefaultText/index.js b/src/components/Input/DefaultText/index.js
index f500d17..52cba9f 100644
--- a/src/components/Input/DefaultText/index.js
+++ b/src/components/Input/DefaultText/index.js
@@ -11,6 +11,7 @@ const DefaultTextInput = props => (
keyboardType={props.keyboardType}
/>
{props.isFilled && Wajib diisi}
+ {props.maxValue && Umur maximum 100}
);
@@ -25,15 +26,15 @@ const styles = StyleSheet.create({
borderRadius: 10,
},
label: {
- color: 'black',
- marginLeft: 10,
- fontSize: 12
+ color: 'black',
+ marginLeft: 10,
+ fontSize: 12,
},
errorLabel: {
- color: 'red',
- marginLeft: 10,
- marginBottom: 5,
- fontSize: 10
+ color: 'red',
+ marginLeft: 10,
+ marginBottom: 5,
+ fontSize: 10,
},
});
diff --git a/src/scenes/ContactDetail/index.js b/src/scenes/ContactDetail/index.js
index 2a6a8ac..5eabd6e 100644
--- a/src/scenes/ContactDetail/index.js
+++ b/src/scenes/ContactDetail/index.js
@@ -13,6 +13,7 @@ const ContactDetail = ({route, navigation}) => {
let isEmpty = false;
if (
form.age.trim() === '' ||
+ Number(form.age) > 100 ||
form.firstName.trim() === '' ||
form.lastName.trim() === '' ||
(image.foto == null && image.fileUri == null)
@@ -62,10 +63,13 @@ const ContactDetail = ({route, navigation}) => {
onChangeInput('age', val)}
label="Age (*)"
- containerStyle={{height: form.age.trim() === '' ? 80 : 60}}
+ containerStyle={{
+ height: form.age.trim() === '' || Number(form.age) > 100 ? 80 : 60,
+ }}
value={form.age}
isFilled={form.age.trim() === ''}
keyboardType="number-pad"
+ maxValue={Number(form.age) > 100}
/>
diff --git a/src/scenes/ContactDetail/useContactDetail.js b/src/scenes/ContactDetail/useContactDetail.js
index a7cff7f..bb90792 100644
--- a/src/scenes/ContactDetail/useContactDetail.js
+++ b/src/scenes/ContactDetail/useContactDetail.js
@@ -44,7 +44,7 @@ const useContactDetail = (data, navigation) => {
const payload = {
firstName: form.firstName,
lastName: form.lastName,
- age: Number(form.age),
+ age: form.age,
photo: image.file ? `data:image/png;base64,${image.file}` : image.foto,
};
if (data) {