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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 503 additions and 261 deletions

View file

@ -114,24 +114,30 @@ class ListTimeline extends PureComponent {
};
handleEditClick = () => {
this.props.dispatch(openModal('LIST_EDITOR', { listId: this.props.params.id }));
this.props.dispatch(openModal({
modalType: 'LIST_EDITOR',
modalProps: { listId: this.props.params.id },
}));
};
handleDeleteClick = () => {
const { dispatch, columnId, intl } = this.props;
const { id } = this.props.params;
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.deleteMessage),
confirm: intl.formatMessage(messages.deleteConfirm),
onConfirm: () => {
dispatch(deleteList(id));
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
message: intl.formatMessage(messages.deleteMessage),
confirm: intl.formatMessage(messages.deleteConfirm),
onConfirm: () => {
dispatch(deleteList(id));
if (columnId) {
dispatch(removeColumn(columnId));
} else {
this.context.router.history.push('/lists');
}
if (columnId) {
dispatch(removeColumn(columnId));
} else {
this.context.router.history.push('/lists');
}
},
},
}));
};