changed actionModal params to options object

This commit is contained in:
Sadaqat Ali 2022-02-14 18:49:51 +05:00
parent 93546c8d55
commit 3aa9fec9a6
2 changed files with 9 additions and 15 deletions

View File

@ -23,17 +23,11 @@ export const toastNotification = (payload:string) => ({
type: TOAST_NOTIFICATION,
});
export const showActionModal = (title:string, body?:string, para?: string, buttons?:AlertButton[], headerContent?:any, headerImage?:any, onClosed?:()=>void) => ({
export const showActionModal = (payload:any) => ({
payload: {
actionModalVisible: new Date().getTime(),
actionModalData: {
title,
body,
para,
buttons,
headerContent,
headerImage,
onClosed,
...payload
},
},
type: SHOW_ACTION_MODAL,

View File

@ -189,9 +189,9 @@ class DelegateScreen extends Component {
} else {
// this.amountTextInput.current.blur();
dispatch(
showActionModal(
intl.formatMessage({ id: 'transfer.confirm' }),
intl.formatMessage(
showActionModal({
title: intl.formatMessage({ id: 'transfer.confirm' }),
body: intl.formatMessage(
{ id: 'transfer.confirm_summary' },
{
hp: hp,
@ -200,13 +200,13 @@ class DelegateScreen extends Component {
delegator: destination,
},
),
intl.formatMessage(
para: intl.formatMessage(
{ id: 'transfer.confirm_summary_para' },
{
prev: delegatedHP,
},
),
[
buttons: [
{
text: intl.formatMessage({ id: 'alert.cancel' }),
onPress: () => console.log('Cancel'),
@ -216,8 +216,8 @@ class DelegateScreen extends Component {
onPress: () => this._handleTransferAction(),
},
],
this._renderToFromAvatars(),
),
headerContent: this._renderToFromAvatars(),
}),
);
}
};