mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-15 04:35:57 +05:30
#117: scroll to top on route transition
This commit is contained in:
parent
d9f0d61297
commit
cbf0fc979e
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Route, IndexRoute } from 'react-router';
|
import { Route, IndexRoute, browserHistory } from 'react-router';
|
||||||
|
|
||||||
import RootPage from 'pages/root/RootPage';
|
import RootPage from 'pages/root/RootPage';
|
||||||
import IndexPage from 'pages/index/IndexPage';
|
import IndexPage from 'pages/index/IndexPage';
|
||||||
@ -26,6 +26,11 @@ import Finish from 'components/auth/finish/Finish';
|
|||||||
|
|
||||||
import authFlow from 'services/authFlow';
|
import authFlow from 'services/authFlow';
|
||||||
|
|
||||||
|
browserHistory.listen(() => {
|
||||||
|
// scroll to top on route transition
|
||||||
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
||||||
|
});
|
||||||
|
|
||||||
export default function routesFactory(store) {
|
export default function routesFactory(store) {
|
||||||
authFlow.setStore(store);
|
authFlow.setStore(store);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user