From ffea738a846f34e58a6a917a313b9e9ce05a071a Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Thu, 18 May 2017 19:14:03 +0200 Subject: [PATCH] refactor: Import from react-router/lib (#3117) --- app/javascript/mastodon/containers/mastodon.js | 14 ++++++-------- .../features/account/components/action_bar.js | 2 +- .../features/compose/components/navigation_bar.js | 2 +- .../features/compose/components/search_results.js | 2 +- app/javascript/mastodon/features/compose/index.js | 2 +- .../mastodon/features/getting_started/index.js | 2 +- .../mastodon/features/home_timeline/index.js | 2 +- .../features/status/components/detailed_status.js | 2 +- .../mastodon/features/ui/components/column_link.js | 2 +- .../mastodon/features/ui/components/tabs_bar.js | 2 +- 10 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/javascript/mastodon/containers/mastodon.js b/app/javascript/mastodon/containers/mastodon.js index ef2af8041c..48648d2ca4 100644 --- a/app/javascript/mastodon/containers/mastodon.js +++ b/app/javascript/mastodon/containers/mastodon.js @@ -13,14 +13,12 @@ import { import { showOnboardingOnce } from '../actions/onboarding'; import { updateNotifications, refreshNotifications } from '../actions/notifications'; import createBrowserHistory from 'history/lib/createBrowserHistory'; -import { - applyRouterMiddleware, - useRouterHistory, - Router, - Route, - IndexRedirect, - IndexRoute -} from 'react-router'; +import applyRouterMiddleware from 'react-router/lib/applyRouterMiddleware'; +import useRouterHistory from 'react-router/lib/useRouterHistory'; +import Router from 'react-router/lib/Router'; +import Route from 'react-router/lib/Route'; +import IndexRedirect from 'react-router/lib/IndexRedirect'; +import IndexRoute from 'react-router/lib/IndexRoute'; import { useScroll } from 'react-router-scroll'; import UI from '../features/ui'; import Status from '../features/status'; diff --git a/app/javascript/mastodon/features/account/components/action_bar.js b/app/javascript/mastodon/features/account/components/action_bar.js index e1b9f3c096..44ed8af7d1 100644 --- a/app/javascript/mastodon/features/account/components/action_bar.js +++ b/app/javascript/mastodon/features/account/components/action_bar.js @@ -2,7 +2,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import DropdownMenu from '../../../components/dropdown_menu'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import { defineMessages, injectIntl, FormattedMessage, FormattedNumber } from 'react-intl'; const messages = defineMessages({ diff --git a/app/javascript/mastodon/features/compose/components/navigation_bar.js b/app/javascript/mastodon/features/compose/components/navigation_bar.js index ca2d9c3f11..e9ffa67c4c 100644 --- a/app/javascript/mastodon/features/compose/components/navigation_bar.js +++ b/app/javascript/mastodon/features/compose/components/navigation_bar.js @@ -5,7 +5,7 @@ import IconButton from '../../../components/icon_button'; import DisplayName from '../../../components/display_name'; import Permalink from '../../../components/permalink'; import { FormattedMessage } from 'react-intl'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import ImmutablePureComponent from 'react-immutable-pure-component'; class NavigationBar extends ImmutablePureComponent { diff --git a/app/javascript/mastodon/features/compose/components/search_results.js b/app/javascript/mastodon/features/compose/components/search_results.js index 790309e88e..87dc810e5b 100644 --- a/app/javascript/mastodon/features/compose/components/search_results.js +++ b/app/javascript/mastodon/features/compose/components/search_results.js @@ -3,7 +3,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import AccountContainer from '../../../containers/account_container'; import StatusContainer from '../../../containers/status_container'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import ImmutablePureComponent from 'react-immutable-pure-component'; class SearchResults extends ImmutablePureComponent { diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index 1359ee8bb3..3d066ba55c 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -5,7 +5,7 @@ import NavigationContainer from './containers/navigation_container'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { mountCompose, unmountCompose } from '../../actions/compose'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import { injectIntl, defineMessages } from 'react-intl'; import SearchContainer from './containers/search_container'; import { Motion, spring } from 'react-motion'; diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index f375811803..bbde15c65c 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -2,7 +2,7 @@ import React from 'react'; import Column from '../ui/components/column'; import ColumnLink from '../ui/components/column_link'; import ColumnSubheading from '../ui/components/column_subheading'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; diff --git a/app/javascript/mastodon/features/home_timeline/index.js b/app/javascript/mastodon/features/home_timeline/index.js index 2cb6c5c849..a44ba68825 100644 --- a/app/javascript/mastodon/features/home_timeline/index.js +++ b/app/javascript/mastodon/features/home_timeline/index.js @@ -5,7 +5,7 @@ import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../ui/components/column'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ColumnSettingsContainer from './containers/column_settings_container'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; const messages = defineMessages({ title: { id: 'column.home', defaultMessage: 'Home' } diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 05e6f1e567..57077da451 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -7,7 +7,7 @@ import StatusContent from '../../../components/status_content'; import MediaGallery from '../../../components/media_gallery'; import VideoPlayer from '../../../components/video_player'; import AttachmentList from '../../../components/attachment_list'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import { FormattedDate, FormattedNumber } from 'react-intl'; import CardContainer from '../containers/card_container'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/ui/components/column_link.js b/app/javascript/mastodon/features/ui/components/column_link.js index cffe796ba1..dd30b14e09 100644 --- a/app/javascript/mastodon/features/ui/components/column_link.js +++ b/app/javascript/mastodon/features/ui/components/column_link.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; const ColumnLink = ({ icon, text, to, href, method, hideOnMobile }) => { if (href) { diff --git a/app/javascript/mastodon/features/ui/components/tabs_bar.js b/app/javascript/mastodon/features/ui/components/tabs_bar.js index b6a30bc116..b108e8244d 100644 --- a/app/javascript/mastodon/features/ui/components/tabs_bar.js +++ b/app/javascript/mastodon/features/ui/components/tabs_bar.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Link } from 'react-router'; +import Link from 'react-router/lib/Link'; import { FormattedMessage } from 'react-intl'; class TabsBar extends React.Component {