diff --git a/src/components/Main.js b/src/components/Main.js index f5d915f..b5787a4 100644 --- a/src/components/Main.js +++ b/src/components/Main.js @@ -1,18 +1,10 @@ -import React, { useCallback, useEffect } from 'react' +import React from 'react' import { Main } from '@aragon/ui' import { useAppState } from '../providers/AppState' export default function MainWrapper({ children }) { const { appearance } = useAppState() - const scrollTop = useCallback(() => window.scrollTo(0, 0), []) - - useEffect(() => { - window.addEventListener('beforeunload', scrollTop) - - return () => window.removeEventListener('beforeunload', scrollTop) - }, [scrollTop]) - return (
{children} diff --git a/src/components/MainView.js b/src/components/MainView.js index ccd5b31..6922620 100644 --- a/src/components/MainView.js +++ b/src/components/MainView.js @@ -24,7 +24,7 @@ function MainView({ children }) { position: relative; z-index: 100; width: 100%; - height: 100vh; + min-height: 100vh; background: no-repeat center/170px url(/splash_1.svg), linear-gradient(289.78deg, #01E8F7 18.35%, #00C2FF 80.68%); !important diff --git a/src/components/ProposalsView.js b/src/components/ProposalsView.js index aa7edff..647fa8d 100644 --- a/src/components/ProposalsView.js +++ b/src/components/ProposalsView.js @@ -18,7 +18,7 @@ import IdentityBadge from './IdentityBadge' import { Amount } from '../screens/ProposalDetail' import { ZERO_ADDR } from '../constants' -const PROPOSALS_PER_PAGE = 5 +const PROPOSALS_PER_PAGE = 10 function ProposalsView({ proposals, requestToken }) { const [page, setPage] = useState(0) diff --git a/src/components/ScrollTop.js b/src/components/ScrollTop.js new file mode 100644 index 0000000..e4970ca --- /dev/null +++ b/src/components/ScrollTop.js @@ -0,0 +1,13 @@ +import { useEffect } from 'react' +import { useLocation } from 'react-router-dom' + +export default function ScrollToTop() { + const { pathname } = useLocation() + + useEffect(() => { + document.querySelector('body').scrollY = 0 + window.scrollY = 0 + }, [pathname]) + + return null +} diff --git a/src/hooks/useBlock.js b/src/hooks/useBlock.js index 28e6651..21aee49 100644 --- a/src/hooks/useBlock.js +++ b/src/hooks/useBlock.js @@ -5,7 +5,7 @@ import { useWallet } from '../providers/Wallet' import { getNetwork } from '../networks' const NETWORK_TIMES = new Map([ - ['main', 13], + ['mainnet', 13], ['kovan', 4], ['rinkeby', 14], ['ropsten', 11], diff --git a/src/index.js b/src/index.js index 41dadbc..a8c12e4 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ import * as Sentry from '@sentry/browser' import App from './App' import Main from './components/Main' import MainView from './components/MainView' +import ScrollTop from './components/ScrollTop' import { WalletProvider } from './providers/Wallet' import { AppStateProvider } from './providers/AppState' import env from './environment' @@ -24,6 +25,7 @@ ReactDOM.render( +