Rewrite actions/modal and reducers/modal with typescript (#24833)

This commit is contained in:
fusagiko / takayamaki
2023-05-25 22:42:37 +09:00
committed by GitHub
parent 4197b5e4c8
commit 38c6216082
38 changed files with 503 additions and 261 deletions

View File

@ -74,19 +74,25 @@ class Footer extends ImmutablePureComponent {
if (signedIn) {
if (askReplyConfirmation) {
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.replyMessage),
confirm: intl.formatMessage(messages.replyConfirm),
onConfirm: this._performReply,
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
message: intl.formatMessage(messages.replyMessage),
confirm: intl.formatMessage(messages.replyConfirm),
onConfirm: this._performReply,
},
}));
} else {
this._performReply();
}
} else {
dispatch(openModal('INTERACTION', {
type: 'reply',
accountId: status.getIn(['account', 'id']),
url: status.get('url'),
dispatch(openModal({
modalType: 'INTERACTION',
modalProps: {
type: 'reply',
accountId: status.getIn(['account', 'id']),
url: status.get('url'),
},
}));
}
};
@ -102,10 +108,13 @@ class Footer extends ImmutablePureComponent {
dispatch(favourite(status));
}
} else {
dispatch(openModal('INTERACTION', {
type: 'favourite',
accountId: status.getIn(['account', 'id']),
url: status.get('url'),
dispatch(openModal({
modalType: 'INTERACTION',
modalProps: {
type: 'favourite',
accountId: status.getIn(['account', 'id']),
url: status.get('url'),
},
}));
}
};
@ -128,10 +137,13 @@ class Footer extends ImmutablePureComponent {
dispatch(initBoostModal({ status, onReblog: this._performReblog }));
}
} else {
dispatch(openModal('INTERACTION', {
type: 'reblog',
accountId: status.getIn(['account', 'id']),
url: status.get('url'),
dispatch(openModal({
modalType: 'INTERACTION',
modalProps: {
type: 'reblog',
accountId: status.getIn(['account', 'id']),
url: status.get('url'),
},
}));
}
};