Update Alert Dialog Box UI
This commit is contained in:
parent
54bf7fa523
commit
17782b7e4c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -48,8 +48,19 @@ class AddAccountCard extends React.PureComponent {
|
||||||
setCardNumber = (cn) => {
|
setCardNumber = (cn) => {
|
||||||
this.setState({ valid: cn.length == 16 ? true : false })
|
this.setState({ valid: cn.length == 16 ? true : false })
|
||||||
}
|
}
|
||||||
|
|
||||||
submitAddAccountCard = async () => {
|
submitAddAccountCard = async () => {
|
||||||
|
const showInfoModal = (message) => {
|
||||||
|
this.props.openModal({
|
||||||
|
open: true,
|
||||||
|
title: "Information",
|
||||||
|
body: message,
|
||||||
|
yesButtonOnly: true,
|
||||||
|
yesText: "Okay",
|
||||||
|
theme: this.props.app_theme
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
let accounts = await DB.accounts();
|
let accounts = await DB.accounts();
|
||||||
let included = accounts.find((account) => {
|
let included = accounts.find((account) => {
|
||||||
return account.data.card_number === this.state.cardnumber
|
return account.data.card_number === this.state.cardnumber
|
||||||
|
@ -83,12 +94,12 @@ class AddAccountCard extends React.PureComponent {
|
||||||
});
|
});
|
||||||
}, 700);
|
}, 700);
|
||||||
} else {
|
} else {
|
||||||
Alert.alert("Information", '\n' + JSON.stringify(process))
|
showInfoModal(JSON.stringify(process));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
theme: this.props.app_theme
|
theme: this.props.app_theme
|
||||||
})
|
})
|
||||||
}, 300) : Alert.alert("Information", '\n' + res.message)
|
}, 300) : showInfoModal(res.message);
|
||||||
} else {
|
} else {
|
||||||
this.setState({ loading: true })
|
this.setState({ loading: true })
|
||||||
this.validateCard(success => {
|
this.validateCard(success => {
|
||||||
|
@ -109,17 +120,17 @@ class AddAccountCard extends React.PureComponent {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, err => {
|
}, err => {
|
||||||
Alert.alert("Information", `\n${err.message}`);
|
showInfoModal(err.message);
|
||||||
this.setState({ loading: false })
|
this.setState({ loading: false })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({ loading: false })
|
this.setState({ loading: false })
|
||||||
Platform.OS == 'ios' ? setTimeout(() => {
|
Platform.OS == 'ios' ? setTimeout(() => {
|
||||||
Alert.alert("Information", '\n' + success.message)
|
showInfoModal(success.message);
|
||||||
}, 300) : Alert.alert("Information", '\n' + success.message)
|
}, 300) : showInfoModal(success.message);
|
||||||
}
|
}
|
||||||
}, err => {
|
}, err => {
|
||||||
Alert.alert("Information", `\n${err.message}`);
|
showInfoModal(err.message);
|
||||||
this.setState({ loading: false })
|
this.setState({ loading: false })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue