diff --git a/src/ui/component/app/view.jsx b/src/ui/component/app/view.jsx index 8f2ea7f64..74be7a2d6 100644 --- a/src/ui/component/app/view.jsx +++ b/src/ui/component/app/view.jsx @@ -70,14 +70,14 @@ class App extends React.PureComponent { return (
openContextMenu(e)}>
-
+
{enhancedLayout && }
-
+
); } diff --git a/src/ui/component/router/view.jsx b/src/ui/component/router/view.jsx index 6f8de4ae9..03cd902fc 100644 --- a/src/ui/component/router/view.jsx +++ b/src/ui/component/router/view.jsx @@ -1,5 +1,5 @@ import * as PAGES from 'constants/pages'; -import React from 'react'; +import React, { useEffect } from 'react'; import { Router } from '@reach/router'; import SettingsPage from 'page/settings'; import HelpPage from 'page/help'; @@ -21,31 +21,46 @@ import UserHistoryPage from 'page/userHistory'; import SendCreditsPage from 'page/sendCredits'; import NavigationHistory from 'page/navigationHistory'; -export default function AppRouter(props) { +const ScrollHandler = props => { + const { key } = props.location; + + useEffect(() => { + // This shouldn't scroll to top when you click "back" + // Might take some more work but fixes scroll position being stuck on navigation for now + const main = document.querySelector('main'); + main.scrollIntoView(); + }, [key]); + + return props.children; +}; + +export default function AppRouter() { return ( - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + ); }