From d42ed78aa432e448346f2b9585ee983e08631ba0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 13 Nov 2016 14:01:21 +0100 Subject: Fix #110 - Make web UI use browser history, change links in e-mails to link to that --- .../javascripts/components/containers/mastodon.jsx | 71 ++++++++++++---------- 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'app/assets/javascripts/components/containers/mastodon.jsx') diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index f29893ec0..20b57998a 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -1,39 +1,44 @@ -import { Provider } from 'react-redux'; -import configureStore from '../store/configureStore'; +import { Provider } from 'react-redux'; +import configureStore from '../store/configureStore'; import { refreshTimelineSuccess, updateTimeline, deleteFromTimelines, refreshTimeline -} from '../actions/timelines'; +} from '../actions/timelines'; import { setAccessToken } from '../actions/meta'; import { setAccountSelf } from '../actions/accounts'; -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; +import createBrowserHistory from 'history/lib/createBrowserHistory'; import { applyRouterMiddleware, + useRouterHistory, Router, Route, - hashHistory, IndexRoute -} from 'react-router'; -import { useScroll } from 'react-router-scroll'; -import UI from '../features/ui'; -import Account from '../features/account'; -import Status from '../features/status'; -import GettingStarted from '../features/getting_started'; -import PublicTimeline from '../features/public_timeline'; -import AccountTimeline from '../features/account_timeline'; -import HomeTimeline from '../features/home_timeline'; -import MentionsTimeline from '../features/mentions_timeline'; -import Compose from '../features/compose'; -import Followers from '../features/followers'; -import Following from '../features/following'; -import Reblogs from '../features/reblogs'; -import Favourites from '../features/favourites'; -import HashtagTimeline from '../features/hashtag_timeline'; +} from 'react-router'; +import { useScroll } from 'react-router-scroll'; +import UI from '../features/ui'; +import Account from '../features/account'; +import Status from '../features/status'; +import GettingStarted from '../features/getting_started'; +import PublicTimeline from '../features/public_timeline'; +import AccountTimeline from '../features/account_timeline'; +import HomeTimeline from '../features/home_timeline'; +import MentionsTimeline from '../features/mentions_timeline'; +import Compose from '../features/compose'; +import Followers from '../features/followers'; +import Following from '../features/following'; +import Reblogs from '../features/reblogs'; +import Favourites from '../features/favourites'; +import HashtagTimeline from '../features/hashtag_timeline'; const store = configureStore(); +const browserHistory = useRouterHistory(createBrowserHistory)({ + basename: '/web' +}); + const Mastodon = React.createClass({ propTypes: { @@ -78,24 +83,24 @@ const Mastodon = React.createClass({ render () { return ( - + - - - - - + + + + - - - + + + + - + - - + + -- cgit