Merge branch 'react-router-5' into 'develop'

Upgrade react-router-dom to v5.3

See merge request soapbox-pub/soapbox-fe!1111
This commit is contained in:
Alex Gleason 2022-03-21 20:49:17 +00:00
commit 4782afed18
53 changed files with 269 additions and 372 deletions

View File

@ -1,26 +1,25 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { withRouter } from 'react-router-dom';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
export default class ColumnBackButton extends React.PureComponent { export default @withRouter
class ColumnBackButton extends React.PureComponent {
static propTypes = { static propTypes = {
to: PropTypes.string, to: PropTypes.string,
}; history: PropTypes.object,
static contextTypes = {
router: PropTypes.object,
}; };
handleClick = () => { handleClick = () => {
const { to } = this.props; const { to } = this.props;
if (window.history?.length === 1) { if (window.history?.length === 1) {
this.context.router.history.push(to ? to : '/'); this.props.history.push(to ? to : '/');
} else { } else {
this.context.router.history.goBack(); this.props.history.goBack();
} }
} }

View File

@ -2,6 +2,7 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { withRouter } from 'react-router-dom';
// import classNames from 'classnames'; // import classNames from 'classnames';
// import { injectIntl, defineMessages } from 'react-intl'; // import { injectIntl, defineMessages } from 'react-intl';
@ -13,11 +14,8 @@ import SubNavigation from 'soapbox/components/sub_navigation';
// hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' }, // hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' },
// }); // });
export default class ColumnHeader extends React.PureComponent { export default @withRouter
class ColumnHeader extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
// intl: PropTypes.object.isRequired, // intl: PropTypes.object.isRequired,
@ -26,6 +24,7 @@ export default class ColumnHeader extends React.PureComponent {
active: PropTypes.bool, active: PropTypes.bool,
extraButton: PropTypes.node, extraButton: PropTypes.node,
children: PropTypes.node, children: PropTypes.node,
history: PropTypes.object,
}; };
state = { state = {
@ -35,9 +34,9 @@ export default class ColumnHeader extends React.PureComponent {
historyBack = () => { historyBack = () => {
if (window.history?.length === 1) { if (window.history?.length === 1) {
this.context.router.history.push('/'); this.props.history.push('/');
} else { } else {
this.context.router.history.goBack(); this.props.history.goBack();
} }
} }

View File

@ -5,6 +5,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import spring from 'react-motion/lib/spring'; import spring from 'react-motion/lib/spring';
import Overlay from 'react-overlays/lib/Overlay'; import Overlay from 'react-overlays/lib/Overlay';
import { withRouter } from 'react-router-dom';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -15,12 +16,9 @@ import IconButton from './icon_button';
const listenerOptions = supportsPassiveEvents ? { passive: true } : false; const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
let id = 0; let id = 0;
@withRouter
class DropdownMenu extends React.PureComponent { class DropdownMenu extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
items: PropTypes.array.isRequired, items: PropTypes.array.isRequired,
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
@ -29,6 +27,7 @@ class DropdownMenu extends React.PureComponent {
arrowOffsetLeft: PropTypes.string, arrowOffsetLeft: PropTypes.string,
arrowOffsetTop: PropTypes.string, arrowOffsetTop: PropTypes.string,
openedViaKeyboard: PropTypes.bool, openedViaKeyboard: PropTypes.bool,
history: PropTypes.object,
}; };
static defaultProps = { static defaultProps = {
@ -124,7 +123,7 @@ class DropdownMenu extends React.PureComponent {
action(e); action(e);
} else if (to) { } else if (to) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(to); this.props.history.push(to);
} }
} }
@ -196,11 +195,8 @@ class DropdownMenu extends React.PureComponent {
} }
export default class Dropdown extends React.PureComponent { export default @withRouter
class Dropdown extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
icon: PropTypes.string, icon: PropTypes.string,
@ -221,6 +217,7 @@ export default class Dropdown extends React.PureComponent {
openedViaKeyboard: PropTypes.bool, openedViaKeyboard: PropTypes.bool,
text: PropTypes.string, text: PropTypes.string,
onShiftClick: PropTypes.func, onShiftClick: PropTypes.func,
history: PropTypes.object,
}; };
static defaultProps = { static defaultProps = {
@ -292,7 +289,7 @@ export default class Dropdown extends React.PureComponent {
action(); action();
} else if (to) { } else if (to) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(to); this.props.history.push(to);
} }
} }

View File

@ -2,17 +2,16 @@ import classNames from 'classnames';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { withRouter } from 'react-router-dom';
export default class FilterBar extends React.PureComponent { export default @withRouter
class FilterBar extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
items: PropTypes.array.isRequired, items: PropTypes.array.isRequired,
active: PropTypes.string, active: PropTypes.string,
className: PropTypes.string, className: PropTypes.string,
history: PropTypes.object,
}; };
state = { state = {
@ -88,7 +87,7 @@ export default class FilterBar extends React.PureComponent {
action(e); action(e);
} else if (to) { } else if (to) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(to); this.props.history.push(to);
} }
} }

View File

@ -4,6 +4,7 @@ import React from 'react';
import 'wicg-inert'; import 'wicg-inert';
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { cancelReplyCompose } from '../actions/compose'; import { cancelReplyCompose } from '../actions/compose';
import { openModal, closeModal } from '../actions/modals'; import { openModal, closeModal } from '../actions/modals';
@ -40,6 +41,7 @@ const mapDispatchToProps = (dispatch) => ({
}, },
}); });
@withRouter
class ModalRoot extends React.PureComponent { class ModalRoot extends React.PureComponent {
static propTypes = { static propTypes = {
@ -52,10 +54,7 @@ class ModalRoot extends React.PureComponent {
hasComposeContent: PropTypes.bool, hasComposeContent: PropTypes.bool,
type: PropTypes.string, type: PropTypes.string,
onCancel: PropTypes.func, onCancel: PropTypes.func,
}; history: PropTypes.object,
static contextTypes = {
router: PropTypes.object,
}; };
state = { state = {
@ -115,7 +114,7 @@ class ModalRoot extends React.PureComponent {
componentDidMount() { componentDidMount() {
window.addEventListener('keyup', this.handleKeyUp, false); window.addEventListener('keyup', this.handleKeyUp, false);
window.addEventListener('keydown', this.handleKeyDown, false); window.addEventListener('keydown', this.handleKeyDown, false);
this.history = this.context.router ? this.context.router.history : createBrowserHistory(); this.history = this.props.history || createBrowserHistory();
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {

View File

@ -1,11 +1,9 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { withRouter } from 'react-router-dom';
export default class Permalink extends React.PureComponent { export default @withRouter
class Permalink extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
className: PropTypes.string, className: PropTypes.string,
@ -13,6 +11,7 @@ export default class Permalink extends React.PureComponent {
to: PropTypes.string.isRequired, to: PropTypes.string.isRequired,
children: PropTypes.node, children: PropTypes.node,
onInterceptClick: PropTypes.func, onInterceptClick: PropTypes.func,
history: PropTypes.object,
}; };
handleClick = e => { handleClick = e => {
@ -21,9 +20,9 @@ export default class Permalink extends React.PureComponent {
return; return;
} }
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(this.props.to); this.props.history.push(this.props.to);
} }
} }

View File

@ -38,10 +38,6 @@ const mapStateToProps = state => {
export default @withRouter @connect(mapStateToProps) export default @withRouter @connect(mapStateToProps)
class PrimaryNavigation extends React.PureComponent { class PrimaryNavigation extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
logo: PropTypes.string, logo: PropTypes.string,

View File

@ -4,6 +4,7 @@ import { throttle } from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { getSettings } from 'soapbox/actions/settings'; import { getSettings } from 'soapbox/actions/settings';
import PullToRefresh from 'soapbox/components/pull_to_refresh'; import PullToRefresh from 'soapbox/components/pull_to_refresh';
@ -26,12 +27,9 @@ const mapStateToProps = state => {
}; };
export default @connect(mapStateToProps, null, null, { forwardRef: true }) export default @connect(mapStateToProps, null, null, { forwardRef: true })
@withRouter
class ScrollableList extends PureComponent { class ScrollableList extends PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
scrollKey: PropTypes.string.isRequired, scrollKey: PropTypes.string.isRequired,
onLoadMore: PropTypes.func, onLoadMore: PropTypes.func,
@ -50,6 +48,7 @@ class ScrollableList extends PureComponent {
autoload: PropTypes.bool, autoload: PropTypes.bool,
onRefresh: PropTypes.func, onRefresh: PropTypes.func,
className: PropTypes.string, className: PropTypes.string,
location: PropTypes.object,
}; };
state = { state = {
@ -304,7 +303,7 @@ class ScrollableList extends PureComponent {
index={index} index={index}
listLength={childrenCount} listLength={childrenCount}
intersectionObserverWrapper={this.intersectionObserverWrapper} intersectionObserverWrapper={this.intersectionObserverWrapper}
saveHeightKey={trackScroll ? `${this.context.router.route.location.key}:${scrollKey}` : null} saveHeightKey={trackScroll ? `${this.props.location.key}:${scrollKey}` : null}
> >
{React.cloneElement(child, { {React.cloneElement(child, {
getScrollPosition: this.getScrollPosition, getScrollPosition: this.getScrollPosition,

View File

@ -5,7 +5,7 @@ import { HotKeys } from 'react-hotkeys';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { injectIntl, FormattedMessage } from 'react-intl'; import { injectIntl, FormattedMessage } from 'react-intl';
import { Link, NavLink } from 'react-router-dom'; import { Link, NavLink, withRouter } from 'react-router-dom';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -56,13 +56,9 @@ export const defaultMediaVisibility = (status, displayMedia) => {
return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all'); return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all');
}; };
export default @injectIntl export default @injectIntl @withRouter
class Status extends ImmutablePureComponent { class Status extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map, status: ImmutablePropTypes.map,
account: ImmutablePropTypes.map, account: ImmutablePropTypes.map,
@ -98,6 +94,7 @@ class Status extends ImmutablePureComponent {
displayMedia: PropTypes.string, displayMedia: PropTypes.string,
allowedEmoji: ImmutablePropTypes.list, allowedEmoji: ImmutablePropTypes.list,
focusable: PropTypes.bool, focusable: PropTypes.bool,
history: PropTypes.object,
}; };
static defaultProps = { static defaultProps = {
@ -181,20 +178,20 @@ class Status extends ImmutablePureComponent {
return; return;
} }
if (!this.context.router) { if (!this.props.history) {
return; return;
} }
this.context.router.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`); this.props.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
} }
handleExpandClick = (e) => { handleExpandClick = (e) => {
if (e.button === 0) { if (e.button === 0) {
if (!this.context.router) { if (!this.props.history) {
return; return;
} }
this.context.router.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`); this.props.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
} }
} }
@ -239,7 +236,7 @@ class Status extends ImmutablePureComponent {
handleHotkeyReply = e => { handleHotkeyReply = e => {
e.preventDefault(); e.preventDefault();
this.props.onReply(this._properStatus(), this.context.router.history); this.props.onReply(this._properStatus(), this.props.history);
} }
handleHotkeyFavourite = () => { handleHotkeyFavourite = () => {
@ -252,15 +249,15 @@ class Status extends ImmutablePureComponent {
handleHotkeyMention = e => { handleHotkeyMention = e => {
e.preventDefault(); e.preventDefault();
this.props.onMention(this._properStatus().get('account'), this.context.router.history); this.props.onMention(this._properStatus().get('account'), this.props.history);
} }
handleHotkeyOpen = () => { handleHotkeyOpen = () => {
this.context.router.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`); this.props.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
} }
handleHotkeyOpenProfile = () => { handleHotkeyOpenProfile = () => {
this.context.router.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}`); this.props.history.push(`/@${this._properStatus().getIn(['account', 'acct'])}`);
} }
handleHotkeyMoveUp = e => { handleHotkeyMoveUp = e => {

View File

@ -5,7 +5,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Link } from 'react-router-dom'; import { Link, withRouter } from 'react-router-dom';
import { simpleEmojiReact } from 'soapbox/actions/emoji_reacts'; import { simpleEmojiReact } from 'soapbox/actions/emoji_reacts';
import EmojiSelector from 'soapbox/components/emoji_selector'; import EmojiSelector from 'soapbox/components/emoji_selector';
@ -67,10 +67,6 @@ const messages = defineMessages({
class StatusActionBar extends ImmutablePureComponent { class StatusActionBar extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map.isRequired, status: ImmutablePropTypes.map.isRequired,
onOpenUnauthorizedModal: PropTypes.func.isRequired, onOpenUnauthorizedModal: PropTypes.func.isRequired,
@ -104,6 +100,7 @@ class StatusActionBar extends ImmutablePureComponent {
emojiSelectorFocused: PropTypes.bool, emojiSelectorFocused: PropTypes.bool,
handleEmojiSelectorUnfocus: PropTypes.func.isRequired, handleEmojiSelectorUnfocus: PropTypes.func.isRequired,
features: PropTypes.object.isRequired, features: PropTypes.object.isRequired,
history: PropTypes.object,
}; };
static defaultProps = { static defaultProps = {
@ -125,7 +122,7 @@ class StatusActionBar extends ImmutablePureComponent {
handleReplyClick = () => { handleReplyClick = () => {
const { me, onReply, onOpenUnauthorizedModal, status } = this.props; const { me, onReply, onOpenUnauthorizedModal, status } = this.props;
if (me) { if (me) {
onReply(status, this.context.router.history); onReply(status, this.props.history);
} else { } else {
onOpenUnauthorizedModal('REPLY'); onOpenUnauthorizedModal('REPLY');
} }
@ -208,18 +205,18 @@ class StatusActionBar extends ImmutablePureComponent {
handleQuoteClick = () => { handleQuoteClick = () => {
const { me, onQuote, onOpenUnauthorizedModal, status } = this.props; const { me, onQuote, onOpenUnauthorizedModal, status } = this.props;
if (me) { if (me) {
onQuote(status, this.context.router.history); onQuote(status, this.props.history);
} else { } else {
onOpenUnauthorizedModal('REBLOG'); onOpenUnauthorizedModal('REBLOG');
} }
} }
handleDeleteClick = () => { handleDeleteClick = () => {
this.props.onDelete(this.props.status, this.context.router.history); this.props.onDelete(this.props.status, this.props.history);
} }
handleRedraftClick = () => { handleRedraftClick = () => {
this.props.onDelete(this.props.status, this.context.router.history, true); this.props.onDelete(this.props.status, this.props.history, true);
} }
handlePinClick = () => { handlePinClick = () => {
@ -227,15 +224,15 @@ class StatusActionBar extends ImmutablePureComponent {
} }
handleMentionClick = () => { handleMentionClick = () => {
this.props.onMention(this.props.status.get('account'), this.context.router.history); this.props.onMention(this.props.status.get('account'), this.props.history);
} }
handleDirectClick = () => { handleDirectClick = () => {
this.props.onDirect(this.props.status.get('account'), this.context.router.history); this.props.onDirect(this.props.status.get('account'), this.props.history);
} }
handleChatClick = () => { handleChatClick = () => {
this.props.onChat(this.props.status.get('account'), this.context.router.history); this.props.onChat(this.props.status.get('account'), this.props.history);
} }
handleMuteClick = () => { handleMuteClick = () => {
@ -247,7 +244,7 @@ class StatusActionBar extends ImmutablePureComponent {
} }
handleOpen = () => { handleOpen = () => {
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.get('id')}`); this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.get('id')}`);
} }
handleEmbed = () => { handleEmbed = () => {
@ -679,6 +676,6 @@ const mapDispatchToProps = (dispatch, { status }) => ({
}, },
}); });
export default injectIntl( export default withRouter(injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true }, connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
)(StatusActionBar)); )(StatusActionBar)));

View File

@ -4,6 +4,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { getSoapboxConfig } from 'soapbox/actions/soapbox'; import { getSoapboxConfig } from 'soapbox/actions/soapbox';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -23,12 +24,9 @@ const mapStateToProps = state => ({
}); });
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@withRouter
class StatusContent extends React.PureComponent { class StatusContent extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map.isRequired, status: ImmutablePropTypes.map.isRequired,
reblogContent: PropTypes.string, reblogContent: PropTypes.string,
@ -37,6 +35,7 @@ class StatusContent extends React.PureComponent {
onClick: PropTypes.func, onClick: PropTypes.func,
collapsable: PropTypes.bool, collapsable: PropTypes.bool,
greentext: PropTypes.bool, greentext: PropTypes.bool,
history: PropTypes.object,
}; };
state = { state = {
@ -118,18 +117,18 @@ class StatusContent extends React.PureComponent {
} }
onMentionClick = (mention, e) => { onMentionClick = (mention, e) => {
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(`/@${mention.get('acct')}`); this.props.history.push(`/@${mention.get('acct')}`);
} }
} }
onHashtagClick = (hashtag, e) => { onHashtagClick = (hashtag, e) => {
hashtag = hashtag.replace(/^#/, '').toLowerCase(); hashtag = hashtag.replace(/^#/, '').toLowerCase();
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (this.props.history && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(`/tags/${hashtag}`); this.props.history.push(`/tags/${hashtag}`);
} }
} }
@ -202,7 +201,7 @@ class StatusContent extends React.PureComponent {
const spoilerContent = { __html: status.get('spoilerHtml') }; const spoilerContent = { __html: status.get('spoilerHtml') };
const directionStyle = { direction: 'ltr' }; const directionStyle = { direction: 'ltr' };
const classNames = classnames('status__content', { const classNames = classnames('status__content', {
'status__content--with-action': this.props.onClick && this.context.router, 'status__content--with-action': this.props.onClick && this.props.history,
'status__content--with-spoiler': status.get('spoiler_text').length > 0, 'status__content--with-spoiler': status.get('spoiler_text').length > 0,
'status__content--collapsed': this.state.collapsed === true, 'status__content--collapsed': this.state.collapsed === true,
'status__content--big': onlyEmoji, 'status__content--big': onlyEmoji,

View File

@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { injectIntl, defineMessages } from 'react-intl'; import { injectIntl, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { openModal } from 'soapbox/actions/modals'; import { openModal } from 'soapbox/actions/modals';
import Helmet from 'soapbox/components/helmet'; import Helmet from 'soapbox/components/helmet';
@ -25,6 +26,7 @@ const mapDispatchToProps = (dispatch, { settings: Settings }) => {
export default @connect(undefined, mapDispatchToProps) export default @connect(undefined, mapDispatchToProps)
@injectIntl @injectIntl
@withRouter
class SubNavigation extends React.PureComponent { class SubNavigation extends React.PureComponent {
static propTypes = { static propTypes = {
@ -32,10 +34,7 @@ class SubNavigation extends React.PureComponent {
message: PropTypes.string, message: PropTypes.string,
settings: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), settings: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
onOpenSettings: PropTypes.func.isRequired, onOpenSettings: PropTypes.func.isRequired,
} history: PropTypes.object,
static contextTypes = {
router: PropTypes.object.isRequired,
} }
state = { state = {
@ -44,9 +43,9 @@ class SubNavigation extends React.PureComponent {
handleBackClick = () => { handleBackClick = () => {
if (window.history && window.history.length === 1) { if (window.history && window.history.length === 1) {
this.context.router.history.push('/'); this.props.history.push('/');
} else { } else {
this.context.router.history.goBack(); this.props.history.goBack();
} }
} }

View File

@ -2,12 +2,14 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { withRouter } from 'react-router-dom';
import InnerHeader from '../../account/components/header'; import InnerHeader from '../../account/components/header';
import MovedNote from './moved_note'; import MovedNote from './moved_note';
export default class Header extends ImmutablePureComponent { export default @withRouter
class Header extends ImmutablePureComponent {
static propTypes = { static propTypes = {
account: ImmutablePropTypes.map, account: ImmutablePropTypes.map,
@ -25,10 +27,7 @@ export default class Header extends ImmutablePureComponent {
onEndorseToggle: PropTypes.func.isRequired, onEndorseToggle: PropTypes.func.isRequired,
onAddToList: PropTypes.func.isRequired, onAddToList: PropTypes.func.isRequired,
username: PropTypes.string, username: PropTypes.string,
}; history: PropTypes.object,
static contextTypes = {
router: PropTypes.object,
}; };
handleFollow = () => { handleFollow = () => {
@ -40,11 +39,11 @@ export default class Header extends ImmutablePureComponent {
} }
handleMention = () => { handleMention = () => {
this.props.onMention(this.props.account, this.context.router.history); this.props.onMention(this.props.account, this.props.history);
} }
handleDirect = () => { handleDirect = () => {
this.props.onDirect(this.props.account, this.context.router.history); this.props.onDirect(this.props.account, this.props.history);
} }
handleReport = () => { handleReport = () => {
@ -84,7 +83,7 @@ export default class Header extends ImmutablePureComponent {
} }
handleChat = () => { handleChat = () => {
this.props.onChat(this.props.account, this.context.router.history); this.props.onChat(this.props.account, this.props.history);
} }
handleEndorseToggle = () => { handleEndorseToggle = () => {

View File

@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
@ -12,10 +11,6 @@ import DisplayName from '../../../components/display_name';
export default class MovedNote extends ImmutablePureComponent { export default class MovedNote extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
from: ImmutablePropTypes.map.isRequired, from: ImmutablePropTypes.map.isRequired,
to: ImmutablePropTypes.map.isRequired, to: ImmutablePropTypes.map.isRequired,

View File

@ -7,7 +7,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Link } from 'react-router-dom'; import { Link, withRouter } from 'react-router-dom';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { accountLookup } from 'soapbox/actions/accounts'; import { accountLookup } from 'soapbox/actions/accounts';
@ -52,6 +52,7 @@ const mapStateToProps = (state, props) => ({
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class RegistrationForm extends ImmutablePureComponent { class RegistrationForm extends ImmutablePureComponent {
static propTypes = { static propTypes = {
@ -64,12 +65,9 @@ class RegistrationForm extends ImmutablePureComponent {
supportsAccountLookup: PropTypes.bool, supportsAccountLookup: PropTypes.bool,
inviteToken: PropTypes.string, inviteToken: PropTypes.string,
birthdayRequired: PropTypes.bool, birthdayRequired: PropTypes.bool,
history: PropTypes.object,
} }
static contextTypes = {
router: PropTypes.object,
};
state = { state = {
captchaLoading: true, captchaLoading: true,
submissionLoading: false, submissionLoading: false,
@ -168,14 +166,13 @@ class RegistrationForm extends ImmutablePureComponent {
} }
postRegisterAction = ({ access_token }) => { postRegisterAction = ({ access_token }) => {
const { dispatch, needsConfirmation, needsApproval } = this.props; const { dispatch, needsConfirmation, needsApproval, history } = this.props;
const { router } = this.context;
if (needsConfirmation || needsApproval) { if (needsConfirmation || needsApproval) {
return this.launchModal(); return this.launchModal();
} else { } else {
return dispatch(verifyCredentials(access_token)).then(() => { return dispatch(verifyCredentials(access_token)).then(() => {
router.history.push('/'); history.push('/');
}); });
} }
} }

View File

@ -26,10 +26,6 @@ export default @connect(mapStateToProps)
@injectIntl @injectIntl
class Bookmarks extends ImmutablePureComponent { class Bookmarks extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
shouldUpdateScroll: PropTypes.func, shouldUpdateScroll: PropTypes.func,

View File

@ -6,6 +6,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { injectIntl, defineMessages } from 'react-intl'; import { injectIntl, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import { openChat, launchChat, toggleMainWindow } from 'soapbox/actions/chats'; import { openChat, launchChat, toggleMainWindow } from 'soapbox/actions/chats';
@ -52,17 +53,15 @@ const makeMapStateToProps = () => {
export default @connect(makeMapStateToProps) export default @connect(makeMapStateToProps)
@injectIntl @injectIntl
@withRouter
class ChatPanes extends ImmutablePureComponent { class ChatPanes extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
mainWindowState: PropTypes.string, mainWindowState: PropTypes.string,
panes: ImmutablePropTypes.list, panes: ImmutablePropTypes.list,
history: PropTypes.object,
} }
handleClickChat = (chat) => { handleClickChat = (chat) => {
@ -70,7 +69,7 @@ class ChatPanes extends ImmutablePureComponent {
} }
handleSuggestion = accountId => { handleSuggestion = accountId => {
this.props.dispatch(launchChat(accountId, this.context.router.history)); this.props.dispatch(launchChat(accountId, this.props.history));
} }
handleMainWindowToggle = () => { handleMainWindowToggle = () => {

View File

@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { fetchChats, launchChat } from 'soapbox/actions/chats'; import { fetchChats, launchChat } from 'soapbox/actions/chats';
import AccountSearch from 'soapbox/components/account_search'; import AccountSearch from 'soapbox/components/account_search';
@ -19,23 +20,21 @@ const messages = defineMessages({
export default @connect() export default @connect()
@injectIntl @injectIntl
@withRouter
class ChatIndex extends React.PureComponent { class ChatIndex extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
handleSuggestion = accountId => { handleSuggestion = accountId => {
this.props.dispatch(launchChat(accountId, this.context.router.history, true)); this.props.dispatch(launchChat(accountId, this.props.history, true));
} }
handleClickChat = (chat) => { handleClickChat = (chat) => {
this.context.router.history.push(`/chats/${chat.get('id')}`); this.props.history.push(`/chats/${chat.get('id')}`);
} }
handleRefresh = () => { handleRefresh = () => {

View File

@ -33,10 +33,6 @@ export default @connect(mapStateToProps)
@injectIntl @injectIntl
class CommunityTimeline extends React.PureComponent { class CommunityTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,

View File

@ -6,7 +6,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, FormattedMessage } from 'react-intl'; import { defineMessages, FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom'; import { Link, withRouter } from 'react-router-dom';
import { length } from 'stringz'; import { length } from 'stringz';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -45,16 +45,13 @@ const messages = defineMessages({
schedule: { id: 'compose_form.schedule', defaultMessage: 'Schedule' }, schedule: { id: 'compose_form.schedule', defaultMessage: 'Schedule' },
}); });
export default class ComposeForm extends ImmutablePureComponent { export default @withRouter
class ComposeForm extends ImmutablePureComponent {
state = { state = {
composeFocused: false, composeFocused: false,
} }
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
text: PropTypes.string.isRequired, text: PropTypes.string.isRequired,
@ -155,7 +152,7 @@ export default class ComposeForm extends ImmutablePureComponent {
return; return;
} }
this.props.onSubmit(this.context.router ? this.context.router.history : null, this.props.group); this.props.onSubmit(this.props.history ? this.props.history : null, this.props.group);
} }
onSuggestionsClearRequested = () => { onSuggestionsClearRequested = () => {

View File

@ -19,10 +19,6 @@ const messages = defineMessages({
export default @injectIntl export default @injectIntl
class ReplyIndicator extends ImmutablePureComponent { class ReplyIndicator extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map, status: ImmutablePropTypes.map,
onCancel: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired,

View File

@ -2,6 +2,7 @@ import classNames from 'classnames';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import { withRouter } from 'react-router-dom';
import AutosuggestAccountInput from 'soapbox/components/autosuggest_account_input'; import AutosuggestAccountInput from 'soapbox/components/autosuggest_account_input';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -11,13 +12,9 @@ const messages = defineMessages({
action: { id: 'search.action', defaultMessage: 'Search for “{query}”' }, action: { id: 'search.action', defaultMessage: 'Search for “{query}”' },
}); });
export default @injectIntl export default @injectIntl @withRouter
class Search extends React.PureComponent { class Search extends React.PureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,
};
static propTypes = { static propTypes = {
value: PropTypes.string.isRequired, value: PropTypes.string.isRequired,
submitted: PropTypes.bool, submitted: PropTypes.bool,
@ -30,6 +27,7 @@ class Search extends React.PureComponent {
autoFocus: PropTypes.bool, autoFocus: PropTypes.bool,
autosuggest: PropTypes.bool, autosuggest: PropTypes.bool,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
history: PropTypes.object.isRequired,
}; };
static defaultProps = { static defaultProps = {
@ -57,7 +55,7 @@ class Search extends React.PureComponent {
this.props.onSubmit(); this.props.onSubmit();
if (this.props.openInRoute) { if (this.props.openInRoute) {
this.context.router.history.push('/search'); this.props.history.push('/search');
} }
} }
@ -83,7 +81,7 @@ class Search extends React.PureComponent {
const { onSelected } = this.props; const { onSelected } = this.props;
if (onSelected) { if (onSelected) {
onSelected(accountId, this.context.router.history); onSelected(accountId, this.props.history);
} }
} }

View File

@ -5,6 +5,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import spring from 'react-motion/lib/spring'; import spring from 'react-motion/lib/spring';
import { withRouter } from 'react-router-dom';
import Blurhash from 'soapbox/components/blurhash'; import Blurhash from 'soapbox/components/blurhash';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -51,13 +52,9 @@ const messages = defineMessages({
delete: { id: 'upload_form.undo', defaultMessage: 'Delete' }, delete: { id: 'upload_form.undo', defaultMessage: 'Delete' },
}); });
export default @injectIntl export default @injectIntl @withRouter
class Upload extends ImmutablePureComponent { class Upload extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
media: ImmutablePropTypes.map.isRequired, media: ImmutablePropTypes.map.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
@ -65,6 +62,7 @@ class Upload extends ImmutablePureComponent {
onDescriptionChange: PropTypes.func.isRequired, onDescriptionChange: PropTypes.func.isRequired,
onOpenFocalPoint: PropTypes.func.isRequired, onOpenFocalPoint: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired,
history: PropTypes.object.isRequired,
}; };
state = { state = {
@ -81,7 +79,7 @@ class Upload extends ImmutablePureComponent {
handleSubmit = () => { handleSubmit = () => {
this.handleInputBlur(); this.handleInputBlur();
this.props.onSubmit(this.context.router.history); this.props.onSubmit(this.props.history);
} }
handleUndoClick = e => { handleUndoClick = e => {

View File

@ -2,14 +2,12 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { withRouter } from 'react-router-dom';
import StatusContainer from '../../../containers/status_container'; import StatusContainer from '../../../containers/status_container';
export default class Conversation extends ImmutablePureComponent { export default @withRouter
class Conversation extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
conversationId: PropTypes.string.isRequired, conversationId: PropTypes.string.isRequired,
@ -19,10 +17,11 @@ export default class Conversation extends ImmutablePureComponent {
onMoveUp: PropTypes.func, onMoveUp: PropTypes.func,
onMoveDown: PropTypes.func, onMoveDown: PropTypes.func,
markRead: PropTypes.func.isRequired, markRead: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
handleClick = () => { handleClick = () => {
if (!this.context.router) { if (!this.props.history) {
return; return;
} }
@ -32,8 +31,7 @@ export default class Conversation extends ImmutablePureComponent {
markRead(); markRead();
} }
// : TODO : this.props.history.push(`/statuses/${lastStatusId}`);
this.context.router.history.push(`/statuses/${lastStatusId}`);
} }
handleHotkeyMoveUp = () => { handleHotkeyMoveUp = () => {

View File

@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Link } from 'react-router-dom'; import { Link, withRouter } from 'react-router-dom';
import { changeSettingImmediate } from 'soapbox/actions/settings'; import { changeSettingImmediate } from 'soapbox/actions/settings';
import snackbar from 'soapbox/actions/snackbar'; import snackbar from 'soapbox/actions/snackbar';
@ -17,15 +17,13 @@ const messages = defineMessages({
export default @connect() export default @connect()
@injectIntl @injectIntl
@withRouter
class DevelopersMenu extends React.Component { class DevelopersMenu extends React.Component {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
history: PropTypes.object,
} }
leaveDevelopers = e => { leaveDevelopers = e => {
@ -34,7 +32,7 @@ class DevelopersMenu extends React.Component {
dispatch(changeSettingImmediate(['isDeveloper'], false)); dispatch(changeSettingImmediate(['isDeveloper'], false));
dispatch(snackbar.success(intl.formatMessage(messages.leave))); dispatch(snackbar.success(intl.formatMessage(messages.leave)));
this.context.router.history.push('/'); this.props.history.push('/');
e.preventDefault(); e.preventDefault();
} }

View File

@ -1,20 +1,20 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { withRouter } from 'react-router-dom';
import Column from 'soapbox/features/ui/components/column'; import Column from 'soapbox/features/ui/components/column';
import FollowRecommendationsContainer from './components/follow_recommendations_container'; import FollowRecommendationsContainer from './components/follow_recommendations_container';
export default class FollowRecommendations extends React.Component { export default @withRouter
class FollowRecommendations extends React.Component {
static contextTypes = { static propTypes = {
router: PropTypes.object.isRequired, history: PropTypes.object.isRequired,
}; };
onDone = () => { onDone = () => {
const { router } = this.context; this.props.history.push('/');
router.history.push('/');
} }
render() { render() {

View File

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { changeValue, submit, reset } from '../../../actions/group_editor'; import { changeValue, submit, reset } from '../../../actions/group_editor';
@ -31,12 +32,9 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps) export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl @injectIntl
@withRouter
class Create extends React.PureComponent { class Create extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
}
static propTypes = { static propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired, description: PropTypes.string.isRequired,
@ -48,6 +46,7 @@ class Create extends React.PureComponent {
reset: PropTypes.func.isRequired, reset: PropTypes.func.isRequired,
onDescriptionChange: PropTypes.func.isRequired, onDescriptionChange: PropTypes.func.isRequired,
onCoverImageChange: PropTypes.func.isRequired, onCoverImageChange: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
constructor(props) { constructor(props) {
@ -69,7 +68,7 @@ class Create extends React.PureComponent {
handleSubmit = e => { handleSubmit = e => {
e.preventDefault(); e.preventDefault();
this.props.onSubmit(this.context.router.history); this.props.onSubmit(this.props.history);
} }
render() { render() {

View File

@ -4,6 +4,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import MissingIndicator from 'soapbox/components/missing_indicator'; import MissingIndicator from 'soapbox/components/missing_indicator';
@ -37,12 +38,9 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps) export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl @injectIntl
@withRouter
class Edit extends React.PureComponent { class Edit extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
}
static propTypes = { static propTypes = {
group: ImmutablePropTypes.map, group: ImmutablePropTypes.map,
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
@ -55,6 +53,7 @@ class Edit extends React.PureComponent {
onDescriptionChange: PropTypes.func.isRequired, onDescriptionChange: PropTypes.func.isRequired,
onCoverImageChange: PropTypes.func.isRequired, onCoverImageChange: PropTypes.func.isRequired,
setUp: PropTypes.func.isRequired, setUp: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
constructor(props) { constructor(props) {
@ -82,11 +81,11 @@ class Edit extends React.PureComponent {
handleSubmit = e => { handleSubmit = e => {
e.preventDefault(); e.preventDefault();
this.props.onSubmit(this.context.router.history); this.props.onSubmit(this.props.history);
} }
handleClick = () => { handleClick = () => {
this.props.onSubmit(this.context.router.history); this.props.onSubmit(this.props.history);
} }
render() { render() {

View File

@ -25,10 +25,6 @@ class Header extends ImmutablePureComponent {
toggleMembership: PropTypes.func.isRequired, toggleMembership: PropTypes.func.isRequired,
}; };
static contextTypes = {
router: PropTypes.object,
};
toggle = () => { toggle = () => {
const { group, relationships, toggleMembership } = this.props; const { group, relationships, toggleMembership } = this.props;
toggleMembership(group, relationships); toggleMembership(group, relationships);

View File

@ -28,10 +28,6 @@ export default @connect(mapStateToProps)
@injectIntl @injectIntl
class GroupTimeline extends React.PureComponent { class GroupTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
params: PropTypes.object.isRequired, params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,

View File

@ -3,6 +3,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import Button from 'soapbox/components/button'; import Button from 'soapbox/components/button';
import Column from 'soapbox/features/ui/components/column'; import Column from 'soapbox/features/ui/components/column';
@ -28,18 +29,16 @@ const mapStateToProps = (state, props) => ({
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class ListTimeline extends React.PureComponent { class ListTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
params: PropTypes.object.isRequired, params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
// hasUnread: PropTypes.bool, // hasUnread: PropTypes.bool,
list: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]), list: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]),
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
history: PropTypes.object,
}; };
componentDidMount() { componentDidMount() {
@ -93,7 +92,7 @@ class ListTimeline extends React.PureComponent {
confirm: intl.formatMessage(messages.deleteConfirm), confirm: intl.formatMessage(messages.deleteConfirm),
onConfirm: () => { onConfirm: () => {
dispatch(deleteList(id)); dispatch(deleteList(id));
this.context.router.history.push('/lists'); this.props.history.push('/lists');
}, },
})); }));
} }

View File

@ -5,6 +5,7 @@ import { HotKeys } from 'react-hotkeys';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { injectIntl, FormattedMessage } from 'react-intl'; import { injectIntl, FormattedMessage } from 'react-intl';
import { withRouter } from 'react-router-dom';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
import emojify from 'soapbox/features/emoji/emoji'; import emojify from 'soapbox/features/emoji/emoji';
@ -22,13 +23,9 @@ const notificationForScreenReader = (intl, message, timestamp) => {
return output.join(', '); return output.join(', ');
}; };
export default @injectIntl export default @injectIntl @withRouter
class Notification extends ImmutablePureComponent { class Notification extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
notification: ImmutablePropTypes.map.isRequired, notification: ImmutablePropTypes.map.isRequired,
hidden: PropTypes.bool, hidden: PropTypes.bool,
@ -59,7 +56,7 @@ class Notification extends ImmutablePureComponent {
const { notification } = this.props; const { notification } = this.props;
if (notification.get('status')) { if (notification.get('status')) {
this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}/posts/${notification.getIn(['status', 'id'])}`); this.props.history.push(`/@${notification.getIn(['account', 'acct'])}/posts/${notification.getIn(['status', 'id'])}`);
} else { } else {
this.handleOpenProfile(); this.handleOpenProfile();
} }
@ -67,14 +64,14 @@ class Notification extends ImmutablePureComponent {
handleOpenProfile = () => { handleOpenProfile = () => {
const { notification } = this.props; const { notification } = this.props;
this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); this.props.history.push(`/@${notification.getIn(['account', 'acct'])}`);
} }
handleMention = e => { handleMention = e => {
e.preventDefault(); e.preventDefault();
const { notification, onMention } = this.props; const { notification, onMention } = this.props;
onMention(notification.get('account'), this.context.router.history); onMention(notification.get('account'), this.props.history);
} }
handleHotkeyFavourite = () => { handleHotkeyFavourite = () => {

View File

@ -50,10 +50,6 @@ class Header extends ImmutablePureComponent {
); );
} }
static contextTypes = {
router: PropTypes.object,
};
handleSubmit = (event) => { handleSubmit = (event) => {
const { dispatch, intl } = this.props; const { dispatch, intl } = this.props;
const { username, password } = this.getFormData(event.target); const { username, password } = this.getFormData(event.target);

View File

@ -41,10 +41,6 @@ export default @connect(mapStateToProps)
@injectIntl @injectIntl
class CommunityTimeline extends React.PureComponent { class CommunityTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,

View File

@ -19,10 +19,6 @@ const mapStateToProps = state => {
class PinnedHostsPicker extends React.PureComponent { class PinnedHostsPicker extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
pinnedHosts: ImmutablePropTypes.orderedSet, pinnedHosts: ImmutablePropTypes.orderedSet,

View File

@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { getSettings } from 'soapbox/actions/settings'; import { getSettings } from 'soapbox/actions/settings';
import IconButton from 'soapbox/components/icon_button'; import IconButton from 'soapbox/components/icon_button';
@ -35,12 +36,9 @@ const mapStateToProps = (state, props) => {
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class RemoteTimeline extends React.PureComponent { class RemoteTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
@ -49,6 +47,7 @@ class RemoteTimeline extends React.PureComponent {
timelineId: PropTypes.string, timelineId: PropTypes.string,
instance: PropTypes.string.isRequired, instance: PropTypes.string.isRequired,
pinned: PropTypes.bool, pinned: PropTypes.bool,
history: PropTypes.object,
}; };
componentDidMount() { componentDidMount() {
@ -75,7 +74,7 @@ class RemoteTimeline extends React.PureComponent {
} }
handleCloseClick = e => { handleCloseClick = e => {
this.context.router.history.push('/timeline/fediverse'); this.props.history.push('/timeline/fediverse');
} }
handleLoadMore = maxId => { handleLoadMore = maxId => {

View File

@ -47,10 +47,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
class ScheduledStatusActionBar extends ImmutablePureComponent { class ScheduledStatusActionBar extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map.isRequired, status: ImmutablePropTypes.map.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,

View File

@ -27,10 +27,6 @@ export default @connect(mapStateToProps)
@injectIntl @injectIntl
class ScheduledStatuses extends ImmutablePureComponent { class ScheduledStatuses extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
statusIds: ImmutablePropTypes.orderedSet.isRequired, statusIds: ImmutablePropTypes.orderedSet.isRequired,

View File

@ -4,6 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedDate } from 'react-intl'; import { defineMessages, injectIntl, FormattedDate } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { import {
changeEmail, changeEmail,
@ -243,19 +244,16 @@ class ChangePasswordForm extends ImmutablePureComponent {
@connect(mapStateToProps) @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class SetUpMfa extends ImmutablePureComponent { class SetUpMfa extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
mfa: ImmutablePropTypes.map.isRequired, mfa: ImmutablePropTypes.map.isRequired,
}; };
handleMfaClick = e => { handleMfaClick = e => {
this.context.router.history.push('../auth/mfa'); this.props.history.push('../auth/mfa');
} }
componentDidMount() { componentDidMount() {

View File

@ -5,6 +5,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import snackbar from 'soapbox/actions/snackbar'; import snackbar from 'soapbox/actions/snackbar';
import Button from 'soapbox/components/button'; import Button from 'soapbox/components/button';
@ -58,16 +59,14 @@ const mapStateToProps = state => ({
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class MfaForm extends ImmutablePureComponent { class MfaForm extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
mfa: ImmutablePropTypes.map.isRequired, mfa: ImmutablePropTypes.map.isRequired,
history: PropTypes.object,
}; };
state = { state = {
@ -107,15 +106,13 @@ class MfaForm extends ImmutablePureComponent {
@connect() @connect()
@injectIntl @injectIntl
@withRouter
class DisableOtpForm extends ImmutablePureComponent { class DisableOtpForm extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
state = { state = {
@ -135,7 +132,7 @@ class DisableOtpForm extends ImmutablePureComponent {
dispatch(disableMfa('totp', password)).then(() => { dispatch(disableMfa('totp', password)).then(() => {
dispatch(snackbar.success(intl.formatMessage(messages.mfaDisableSuccess))); dispatch(snackbar.success(intl.formatMessage(messages.mfaDisableSuccess)));
this.context.router.history.push('../auth/edit'); this.props.history.push('../auth/edit');
}).catch(error => { }).catch(error => {
dispatch(snackbar.error(intl.formatMessage(messages.disableFail))); dispatch(snackbar.error(intl.formatMessage(messages.disableFail)));
this.setState({ isLoading: false }); this.setState({ isLoading: false });
@ -184,15 +181,13 @@ class DisableOtpForm extends ImmutablePureComponent {
@connect() @connect()
@injectIntl @injectIntl
@withRouter
class EnableOtpForm extends ImmutablePureComponent { class EnableOtpForm extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
state = { state = {
@ -210,7 +205,7 @@ class EnableOtpForm extends ImmutablePureComponent {
} }
handleCancelClick = e => { handleCancelClick = e => {
this.context.router.history.push('../auth/edit'); this.props.history.push('../auth/edit');
e.preventDefault(); e.preventDefault();
} }
@ -264,14 +259,12 @@ class EnableOtpForm extends ImmutablePureComponent {
@connect() @connect()
@injectIntl @injectIntl
@withRouter
class OtpConfirmForm extends ImmutablePureComponent { class OtpConfirmForm extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
history: PropTypes.object,
}; };
state = { state = {
@ -297,7 +290,7 @@ class OtpConfirmForm extends ImmutablePureComponent {
} }
handleCancelClick = e => { handleCancelClick = e => {
this.context.router.history.push('../auth/edit'); this.props.history.push('../auth/edit');
e.preventDefault(); e.preventDefault();
} }
@ -309,7 +302,7 @@ class OtpConfirmForm extends ImmutablePureComponent {
dispatch(confirmMfa('totp', code, password)).then(() => { dispatch(confirmMfa('totp', code, password)).then(() => {
dispatch(snackbar.success(intl.formatMessage(messages.mfaConfirmSuccess))); dispatch(snackbar.success(intl.formatMessage(messages.mfaConfirmSuccess)));
this.context.router.history.push('../auth/edit'); this.props.history.push('../auth/edit');
}).catch(error => { }).catch(error => {
dispatch(snackbar.error(intl.formatMessage(messages.confirmFail))); dispatch(snackbar.error(intl.formatMessage(messages.confirmFail)));
this.setState({ isLoading: false }); this.setState({ isLoading: false });

View File

@ -3,6 +3,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import EmojiSelector from 'soapbox/components/emoji_selector'; import EmojiSelector from 'soapbox/components/emoji_selector';
import { isUserTouching } from 'soapbox/is_mobile'; import { isUserTouching } from 'soapbox/is_mobile';
@ -78,12 +79,9 @@ const mapDispatchToProps = (dispatch, { status }) => ({
}, },
}); });
@withRouter
class ActionBar extends React.PureComponent { class ActionBar extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map.isRequired, status: ImmutablePropTypes.map.isRequired,
onReply: PropTypes.func.isRequired, onReply: PropTypes.func.isRequired,
@ -116,6 +114,7 @@ class ActionBar extends React.PureComponent {
handleEmojiSelectorExpand: PropTypes.func.isRequired, handleEmojiSelectorExpand: PropTypes.func.isRequired,
handleEmojiSelectorUnfocus: PropTypes.func.isRequired, handleEmojiSelectorUnfocus: PropTypes.func.isRequired,
features: PropTypes.object.isRequired, features: PropTypes.object.isRequired,
history: PropTypes.object,
}; };
static defaultProps = { static defaultProps = {
@ -148,7 +147,7 @@ class ActionBar extends React.PureComponent {
handleQuoteClick = () => { handleQuoteClick = () => {
const { me, onQuote, onOpenUnauthorizedModal, status } = this.props; const { me, onQuote, onOpenUnauthorizedModal, status } = this.props;
if (me) { if (me) {
onQuote(status, this.context.router.history); onQuote(status, this.props.history);
} else { } else {
onOpenUnauthorizedModal('REBLOG'); onOpenUnauthorizedModal('REBLOG');
} }
@ -217,23 +216,23 @@ class ActionBar extends React.PureComponent {
} }
handleDeleteClick = () => { handleDeleteClick = () => {
this.props.onDelete(this.props.status, this.context.router.history); this.props.onDelete(this.props.status, this.props.history);
} }
handleRedraftClick = () => { handleRedraftClick = () => {
this.props.onDelete(this.props.status, this.context.router.history, true); this.props.onDelete(this.props.status, this.props.history, true);
} }
handleDirectClick = () => { handleDirectClick = () => {
this.props.onDirect(this.props.status.get('account'), this.context.router.history); this.props.onDirect(this.props.status.get('account'), this.props.history);
} }
handleChatClick = () => { handleChatClick = () => {
this.props.onChat(this.props.status.get('account'), this.context.router.history); this.props.onChat(this.props.status.get('account'), this.props.history);
} }
handleMentionClick = () => { handleMentionClick = () => {
this.props.onMention(this.props.status.get('account'), this.context.router.history); this.props.onMention(this.props.status.get('account'), this.props.history);
} }
handleMuteClick = () => { handleMuteClick = () => {

View File

@ -27,10 +27,6 @@ import StatusInteractionBar from './status_interaction_bar';
export default @injectIntl export default @injectIntl
class DetailedStatus extends ImmutablePureComponent { class DetailedStatus extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map, status: ImmutablePropTypes.map,
onOpenMedia: PropTypes.func.isRequired, onOpenMedia: PropTypes.func.isRequired,

View File

@ -3,7 +3,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { NavLink } from 'react-router-dom'; import { NavLink, withRouter } from 'react-router-dom';
import AttachmentThumbs from 'soapbox/components/attachment_thumbs'; import AttachmentThumbs from 'soapbox/components/attachment_thumbs';
import Avatar from 'soapbox/components/avatar'; import Avatar from 'soapbox/components/avatar';
@ -16,29 +16,26 @@ const messages = defineMessages({
cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' },
}); });
export default @injectIntl export default @injectIntl @withRouter
class QuotedStatus extends ImmutablePureComponent { class QuotedStatus extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map, status: ImmutablePropTypes.map,
onCancel: PropTypes.func, onCancel: PropTypes.func,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
compose: PropTypes.bool, compose: PropTypes.bool,
history: PropTypes.object,
}; };
handleExpandClick = e => { handleExpandClick = e => {
const { compose, status } = this.props; const { compose, status } = this.props;
if (!compose && e.button === 0) { if (!compose && e.button === 0) {
if (!this.context.router) { if (!this.props.history) {
return; return;
} }
this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/posts/${status.get('id')}`); this.props.history.push(`/@${status.getIn(['account', 'acct'])}/posts/${status.get('id')}`);
e.preventDefault(); e.preventDefault();
} }

View File

@ -7,6 +7,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import { launchChat } from 'soapbox/actions/chats'; import { launchChat } from 'soapbox/actions/chats';
@ -156,14 +157,11 @@ const makeMapStateToProps = () => {
return mapStateToProps; return mapStateToProps;
}; };
export default @injectIntl export default @connect(makeMapStateToProps)
@connect(makeMapStateToProps) @injectIntl
@withRouter
class Status extends ImmutablePureComponent { class Status extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
params: PropTypes.object.isRequired, params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
@ -174,6 +172,7 @@ class Status extends ImmutablePureComponent {
askReplyConfirmation: PropTypes.bool, askReplyConfirmation: PropTypes.bool,
domain: PropTypes.string, domain: PropTypes.string,
displayMedia: PropTypes.string, displayMedia: PropTypes.string,
history: PropTypes.object,
}; };
state = { state = {
@ -233,10 +232,10 @@ class Status extends ImmutablePureComponent {
dispatch(openModal('CONFIRM', { dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.replyMessage), message: intl.formatMessage(messages.replyMessage),
confirm: intl.formatMessage(messages.replyConfirm), confirm: intl.formatMessage(messages.replyConfirm),
onConfirm: () => dispatch(replyCompose(status, this.context.router.history)), onConfirm: () => dispatch(replyCompose(status, this.props.history)),
})); }));
} else { } else {
dispatch(replyCompose(status, this.context.router.history)); dispatch(replyCompose(status, this.props.history));
} }
} }
@ -265,10 +264,10 @@ class Status extends ImmutablePureComponent {
dispatch(openModal('CONFIRM', { dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.replyMessage), message: intl.formatMessage(messages.replyMessage),
confirm: intl.formatMessage(messages.replyConfirm), confirm: intl.formatMessage(messages.replyConfirm),
onConfirm: () => dispatch(quoteCompose(status, this.context.router.history)), onConfirm: () => dispatch(quoteCompose(status, this.props.history)),
})); }));
} else { } else {
dispatch(quoteCompose(status, this.context.router.history)); dispatch(quoteCompose(status, this.props.history));
} }
} }
@ -430,7 +429,7 @@ class Status extends ImmutablePureComponent {
} }
handleHotkeyOpenProfile = () => { handleHotkeyOpenProfile = () => {
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`);
} }
handleHotkeyToggleHidden = () => { handleHotkeyToggleHidden = () => {

View File

@ -3,6 +3,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import IconButton from 'soapbox/components/icon_button'; import IconButton from 'soapbox/components/icon_button';
import LoadingIndicator from 'soapbox/components/loading_indicator'; import LoadingIndicator from 'soapbox/components/loading_indicator';
@ -23,20 +24,18 @@ const mapStateToProps = (state) => {
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class BirthdaysModal extends React.PureComponent { class BirthdaysModal extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
accountIds: ImmutablePropTypes.orderedSet, accountIds: ImmutablePropTypes.orderedSet,
history: PropTypes.object,
}; };
componentDidMount() { componentDidMount() {
this.unlistenHistory = this.context.router.history.listen((_, action) => { this.unlistenHistory = this.props.history.listen((_, action) => {
if (action === 'PUSH') { if (action === 'PUSH') {
this.onClickClose(null, true); this.onClickClose(null, true);
} }

View File

@ -3,6 +3,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { withRouter } from 'react-router-dom';
import AttachmentThumbs from 'soapbox/components/attachment_thumbs'; import AttachmentThumbs from 'soapbox/components/attachment_thumbs';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
@ -18,18 +19,15 @@ const messages = defineMessages({
reblog: { id: 'status.reblog', defaultMessage: 'Repost' }, reblog: { id: 'status.reblog', defaultMessage: 'Repost' },
}); });
export default @injectIntl export default @injectIntl @withRouter
class BoostModal extends ImmutablePureComponent { class BoostModal extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
status: ImmutablePropTypes.map.isRequired, status: ImmutablePropTypes.map.isRequired,
onReblog: PropTypes.func.isRequired, onReblog: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
history: PropTypes.object,
}; };
componentDidMount() { componentDidMount() {
@ -45,7 +43,7 @@ class BoostModal extends ImmutablePureComponent {
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
this.props.onClose(); this.props.onClose();
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`);
} }
} }
@ -53,7 +51,7 @@ class BoostModal extends ImmutablePureComponent {
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
this.props.onClose(); this.props.onClose();
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.get('url')}`); this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.get('url')}`);
} }
} }

View File

@ -4,6 +4,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { withRouter } from 'react-router-dom';
import ReactSwipeableViews from 'react-swipeable-views'; import ReactSwipeableViews from 'react-swipeable-views';
import ExtendedVideoPlayer from 'soapbox/components/extended_video_player'; import ExtendedVideoPlayer from 'soapbox/components/extended_video_player';
@ -20,7 +21,7 @@ const messages = defineMessages({
next: { id: 'lightbox.next', defaultMessage: 'Next' }, next: { id: 'lightbox.next', defaultMessage: 'Next' },
}); });
export default @injectIntl export default @injectIntl @withRouter
class MediaModal extends ImmutablePureComponent { class MediaModal extends ImmutablePureComponent {
static propTypes = { static propTypes = {
@ -30,12 +31,9 @@ class MediaModal extends ImmutablePureComponent {
index: PropTypes.number.isRequired, index: PropTypes.number.isRequired,
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
history: PropTypes.object,
}; };
static contextTypes = {
router: PropTypes.object,
}
state = { state = {
index: null, index: null,
navigationHidden: false, navigationHidden: false,
@ -97,7 +95,7 @@ class MediaModal extends ImmutablePureComponent {
const { status, account } = this.props; const { status, account } = this.props;
const acct = account.get('acct'); const acct = account.get('acct');
const statusId = status.get('id'); const statusId = status.get('id');
this.context.router.history.push(`/@${acct}/posts/${statusId}`); this.props.history.push(`/@${acct}/posts/${statusId}`);
this.props.onClose(null, true); this.props.onClose(null, true);
} }
} }

View File

@ -3,6 +3,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { fetchReblogs } from 'soapbox/actions/interactions'; import { fetchReblogs } from 'soapbox/actions/interactions';
import { fetchStatus } from 'soapbox/actions/statuses'; import { fetchStatus } from 'soapbox/actions/statuses';
@ -23,12 +24,9 @@ const mapStateToProps = (state, props) => {
export default @connect(mapStateToProps) export default @connect(mapStateToProps)
@injectIntl @injectIntl
@withRouter
class ReblogsModal extends React.PureComponent { class ReblogsModal extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = { static propTypes = {
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
@ -36,6 +34,7 @@ class ReblogsModal extends React.PureComponent {
username: PropTypes.string.isRequired, username: PropTypes.string.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
accountIds: ImmutablePropTypes.orderedSet, accountIds: ImmutablePropTypes.orderedSet,
history: PropTypes.object,
}; };
fetchData = () => { fetchData = () => {
@ -47,7 +46,7 @@ class ReblogsModal extends React.PureComponent {
componentDidMount() { componentDidMount() {
this.fetchData(); this.fetchData();
this.unlistenHistory = this.context.router.history.listen((_, action) => { this.unlistenHistory = this.props.history.listen((_, action) => {
if (action === 'PUSH') { if (action === 'PUSH') {
this.onClickClose(null, true); this.onClickClose(null, true);
} }

View File

@ -39,16 +39,13 @@ class TabsBar extends React.PureComponent {
notificationCount: PropTypes.number, notificationCount: PropTypes.number,
chatsCount: PropTypes.number, chatsCount: PropTypes.number,
singleUserMode: PropTypes.bool, singleUserMode: PropTypes.bool,
location: PropTypes.object,
} }
state = { state = {
collapsed: false, collapsed: false,
} }
static contextTypes = {
router: PropTypes.object,
}
setRef = ref => { setRef = ref => {
this.node = ref; this.node = ref;
} }
@ -60,7 +57,7 @@ class TabsBar extends React.PureComponent {
shouldShowLinks = () => { shouldShowLinks = () => {
try { try {
const { pathname } = this.context.router.route.location; const { pathname } = this.props.location;
return (pathname.startsWith('/@') && !pathname.includes('/posts/')) || pathname.startsWith('/admin'); return (pathname.startsWith('/@') && !pathname.includes('/posts/')) || pathname.startsWith('/admin');
} catch { } catch {
return false; return false;

View File

@ -3,10 +3,12 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { withRouter } from 'react-router-dom';
import Video from 'soapbox/features/video'; import Video from 'soapbox/features/video';
export default class VideoModal extends ImmutablePureComponent { export default @withRouter
class VideoModal extends ImmutablePureComponent {
static propTypes = { static propTypes = {
media: ImmutablePropTypes.map.isRequired, media: ImmutablePropTypes.map.isRequired,
@ -14,13 +16,14 @@ export default class VideoModal extends ImmutablePureComponent {
account: ImmutablePropTypes.map, account: ImmutablePropTypes.map,
time: PropTypes.number, time: PropTypes.number,
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
history: PropTypes.object,
}; };
handleStatusClick = e => { handleStatusClick = e => {
const { status, account } = this.props; const { status, account } = this.props;
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
this.context.router.history.push(`/@${account.get('acct')}/posts/${status.get('id')}`); this.props.history.push(`/@${account.get('acct')}/posts/${status.get('id')}`);
} }
} }

View File

@ -349,14 +349,11 @@ export default @connect(mapStateToProps)
@withRouter @withRouter
class UI extends React.PureComponent { class UI extends React.PureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,
};
static propTypes = { static propTypes = {
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
children: PropTypes.node, children: PropTypes.node,
location: PropTypes.object, location: PropTypes.object,
history: PropTypes.object,
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dropdownMenuIsOpen: PropTypes.bool, dropdownMenuIsOpen: PropTypes.bool,
me: SoapboxPropTypes.me, me: SoapboxPropTypes.me,
@ -445,7 +442,7 @@ class UI extends React.PureComponent {
handleServiceWorkerPostMessage = ({ data }) => { handleServiceWorkerPostMessage = ({ data }) => {
if (data.type === 'navigate') { if (data.type === 'navigate') {
this.context.router.history.push(data.path); this.props.history.push(data.path);
} else { } else {
console.warn('Unknown message type:', data.type); console.warn('Unknown message type:', data.type);
} }
@ -596,9 +593,9 @@ class UI extends React.PureComponent {
handleHotkeyBack = () => { handleHotkeyBack = () => {
if (window.history && window.history.length === 1) { if (window.history && window.history.length === 1) {
this.context.router.history.push('/'); this.props.history.push('/');
} else { } else {
this.context.router.history.goBack(); this.props.history.goBack();
} }
} }
@ -617,44 +614,44 @@ class UI extends React.PureComponent {
} }
handleHotkeyGoToHome = () => { handleHotkeyGoToHome = () => {
this.context.router.history.push('/'); this.props.history.push('/');
} }
handleHotkeyGoToNotifications = () => { handleHotkeyGoToNotifications = () => {
this.context.router.history.push('/notifications'); this.props.history.push('/notifications');
} }
handleHotkeyGoToFavourites = () => { handleHotkeyGoToFavourites = () => {
const { account } = this.props; const { account } = this.props;
if (!account) return; if (!account) return;
this.context.router.history.push(`/@${account.get('username')}/favorites`); this.props.history.push(`/@${account.get('username')}/favorites`);
} }
handleHotkeyGoToPinned = () => { handleHotkeyGoToPinned = () => {
const { account } = this.props; const { account } = this.props;
if (!account) return; if (!account) return;
this.context.router.history.push(`/@${account.get('username')}/pins`); this.props.history.push(`/@${account.get('username')}/pins`);
} }
handleHotkeyGoToProfile = () => { handleHotkeyGoToProfile = () => {
const { account } = this.props; const { account } = this.props;
if (!account) return; if (!account) return;
this.context.router.history.push(`/@${account.get('username')}`); this.props.history.push(`/@${account.get('username')}`);
} }
handleHotkeyGoToBlocked = () => { handleHotkeyGoToBlocked = () => {
this.context.router.history.push('/blocks'); this.props.history.push('/blocks');
} }
handleHotkeyGoToMuted = () => { handleHotkeyGoToMuted = () => {
this.context.router.history.push('/mutes'); this.props.history.push('/mutes');
} }
handleHotkeyGoToRequests = () => { handleHotkeyGoToRequests = () => {
this.context.router.history.push('/follow_requests'); this.props.history.push('/follow_requests');
} }
handleOpenComposeModal = () => { handleOpenComposeModal = () => {
@ -662,12 +659,12 @@ class UI extends React.PureComponent {
} }
shouldHideFAB = () => { shouldHideFAB = () => {
const path = this.context.router.history.location.pathname; const path = this.props.location.pathname;
return path.match(/^\/posts\/|^\/search|^\/getting-started|^\/chats/); return path.match(/^\/posts\/|^\/search|^\/getting-started|^\/chats/);
} }
isChatRoomLocation = () => { isChatRoomLocation = () => {
const path = this.context.router.history.location.pathname; const path = this.props.location.pathname;
return path.match(/^\/chats\/(.*)/); return path.match(/^\/chats\/(.*)/);
} }

View File

@ -140,7 +140,7 @@
"react-overlays": "^0.9.0", "react-overlays": "^0.9.0",
"react-popper": "^2.2.3", "react-popper": "^2.2.3",
"react-redux": "^7.2.5", "react-redux": "^7.2.5",
"react-router-dom": "^4.3.1", "react-router-dom": "^5.3.0",
"react-router-scroll-4": "^1.0.0-beta.1", "react-router-scroll-4": "^1.0.0-beta.1",
"react-simple-pull-to-refresh": "^1.3.0", "react-simple-pull-to-refresh": "^1.3.0",
"react-sparklines": "^1.7.0", "react-sparklines": "^1.7.0",

View File

@ -1141,6 +1141,13 @@
dependencies: dependencies:
regenerator-runtime "^0.13.4" regenerator-runtime "^0.13.4"
"@babel/runtime@^7.12.13":
version "7.17.8"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2"
integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.17.0": "@babel/runtime@^7.17.0":
version "7.17.7" version "7.17.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.7.tgz#a5f3328dc41ff39d803f311cfe17703418cf9825" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.7.tgz#a5f3328dc41ff39d803f311cfe17703418cf9825"
@ -5197,7 +5204,7 @@ hex-color-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
history@^4.10.1, history@^4.7.2: history@^4.10.1, history@^4.9.0:
version "4.10.1" version "4.10.1"
resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew== integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
@ -5209,12 +5216,7 @@ history@^4.10.1, history@^4.7.2:
tiny-warning "^1.0.0" tiny-warning "^1.0.0"
value-equal "^1.0.1" value-equal "^1.0.1"
hoist-non-react-statics@^2.5.0: hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
version "2.5.5"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==
hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
version "3.3.2" version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
@ -7230,6 +7232,14 @@ min-indent@^1.0.0:
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==
mini-create-react-context@^0.4.0:
version "0.4.1"
resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==
dependencies:
"@babel/runtime" "^7.12.1"
tiny-warning "^1.0.3"
mini-css-extract-plugin@^1.6.2: mini-css-extract-plugin@^1.6.2:
version "1.6.2" version "1.6.2"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz#83172b4fd812f8fc4a09d6f6d16f924f53990ca8" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz#83172b4fd812f8fc4a09d6f6d16f924f53990ca8"
@ -8414,7 +8424,7 @@ prop-types-extra@^1.0.1:
react-is "^16.3.2" react-is "^16.3.2"
warning "^4.0.0" warning "^4.0.0"
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2" version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@ -8658,7 +8668,7 @@ react-intl@^5.0.0:
intl-messageformat "9.9.1" intl-messageformat "9.9.1"
tslib "^2.1.0" tslib "^2.1.0"
react-is@^16.13.1, react-is@^16.3.2, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6: react-is@^16.13.1, react-is@^16.3.2, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6:
version "16.13.1" version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@ -8726,17 +8736,18 @@ react-redux@^7.2.5:
prop-types "^15.7.2" prop-types "^15.7.2"
react-is "^16.13.1" react-is "^16.13.1"
react-router-dom@^4.3.1: react-router-dom@^5.3.0:
version "4.3.1" version "5.3.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6" resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.3.0.tgz#da1bfb535a0e89a712a93b97dd76f47ad1f32363"
integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA== integrity sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==
dependencies: dependencies:
history "^4.7.2" "@babel/runtime" "^7.12.13"
invariant "^2.2.4" history "^4.9.0"
loose-envify "^1.3.1" loose-envify "^1.3.1"
prop-types "^15.6.1" prop-types "^15.6.2"
react-router "^4.3.1" react-router "5.2.1"
warning "^4.0.1" tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
react-router-scroll-4@^1.0.0-beta.1: react-router-scroll-4@^1.0.0-beta.1:
version "1.0.0-beta.2" version "1.0.0-beta.2"
@ -8746,18 +8757,21 @@ react-router-scroll-4@^1.0.0-beta.1:
scroll-behavior "^0.9.1" scroll-behavior "^0.9.1"
warning "^3.0.0" warning "^3.0.0"
react-router@^4.3.1: react-router@5.2.1:
version "4.3.1" version "5.2.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e" resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.1.tgz#4d2e4e9d5ae9425091845b8dbc6d9d276239774d"
integrity sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg== integrity sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==
dependencies: dependencies:
history "^4.7.2" "@babel/runtime" "^7.12.13"
hoist-non-react-statics "^2.5.0" history "^4.9.0"
invariant "^2.2.4" hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1" loose-envify "^1.3.1"
mini-create-react-context "^0.4.0"
path-to-regexp "^1.7.0" path-to-regexp "^1.7.0"
prop-types "^15.6.1" prop-types "^15.6.2"
warning "^4.0.1" react-is "^16.6.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
react-side-effect@^2.1.0: react-side-effect@^2.1.0:
version "2.1.1" version "2.1.1"
@ -10104,7 +10118,7 @@ tiny-queue@^0.2.1:
resolved "https://registry.yarnpkg.com/tiny-queue/-/tiny-queue-0.2.1.tgz#25a67f2c6e253b2ca941977b5ef7442ef97a6046" resolved "https://registry.yarnpkg.com/tiny-queue/-/tiny-queue-0.2.1.tgz#25a67f2c6e253b2ca941977b5ef7442ef97a6046"
integrity sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY= integrity sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY=
tiny-warning@^1.0.0: tiny-warning@^1.0.0, tiny-warning@^1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==