Update Alert Dialog Box UI

This commit is contained in:
nnajah1 2025-05-08 12:32:29 +08:00
parent 54bf7fa523
commit 17782b7e4c
7 changed files with 18 additions and 7 deletions

Binary file not shown.

View File

@ -48,8 +48,19 @@ class AddAccountCard extends React.PureComponent {
setCardNumber = (cn) => {
this.setState({ valid: cn.length == 16 ? true : false })
}
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 included = accounts.find((account) => {
return account.data.card_number === this.state.cardnumber
@ -83,12 +94,12 @@ class AddAccountCard extends React.PureComponent {
});
}, 700);
} else {
Alert.alert("Information", '\n' + JSON.stringify(process))
showInfoModal(JSON.stringify(process));
}
},
theme: this.props.app_theme
})
}, 300) : Alert.alert("Information", '\n' + res.message)
}, 300) : showInfoModal(res.message);
} else {
this.setState({ loading: true })
this.validateCard(success => {
@ -109,17 +120,17 @@ class AddAccountCard extends React.PureComponent {
})
}
}, err => {
Alert.alert("Information", `\n${err.message}`);
showInfoModal(err.message);
this.setState({ loading: false })
})
} else {
this.setState({ loading: false })
Platform.OS == 'ios' ? setTimeout(() => {
Alert.alert("Information", '\n' + success.message)
}, 300) : Alert.alert("Information", '\n' + success.message)
showInfoModal(success.message);
}, 300) : showInfoModal(success.message);
}
}, err => {
Alert.alert("Information", `\n${err.message}`);
showInfoModal(err.message);
this.setState({ loading: false })
})
}