1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/main' into upstream-20231021

This commit is contained in:
KMY 2023-10-21 10:32:06 +09:00
commit f9eaaec4e7
95 changed files with 1002 additions and 657 deletions

View file

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import classNames from 'classnames';
import { withRouter } from 'react-router-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
@ -15,6 +16,7 @@ import { openModal } from 'mastodon/actions/modal';
import { IconButton } from 'mastodon/components/icon_button';
import { me, boostModal } from 'mastodon/initial_state';
import { makeGetStatus } from 'mastodon/selectors';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';
const messages = defineMessages({
reply: { id: 'status.reply', defaultMessage: 'Reply' },
@ -43,7 +45,6 @@ const makeMapStateToProps = () => {
class Footer extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
identity: PropTypes.object,
};
@ -55,17 +56,17 @@ class Footer extends ImmutablePureComponent {
askReplyConfirmation: PropTypes.bool,
withOpenButton: PropTypes.bool,
onClose: PropTypes.func,
...WithRouterPropTypes,
};
_performReply = () => {
const { dispatch, status, onClose } = this.props;
const { router } = this.context;
const { dispatch, status, onClose, history } = this.props;
if (onClose) {
onClose(true);
}
dispatch(replyCompose(status, router.history));
dispatch(replyCompose(status, history));
};
handleReplyClick = () => {
@ -149,9 +150,7 @@ class Footer extends ImmutablePureComponent {
};
handleOpenClick = e => {
const { router } = this.context;
if (e.button !== 0 || !router) {
if (e.button !== 0 || !history) {
return;
}
@ -161,7 +160,7 @@ class Footer extends ImmutablePureComponent {
onClose();
}
router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`);
history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`);
};
render () {
@ -204,4 +203,4 @@ class Footer extends ImmutablePureComponent {
}
export default connect(makeMapStateToProps)(injectIntl(Footer));
export default withRouter(connect(makeMapStateToProps)(injectIntl(Footer)));