diff --git a/package.json b/package.json index cb5e547..93b100f 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "@material-ui/styles": "^4.3.3", "@nozbe/watermelondb": "^0.9.0", "@nozbe/with-observables": "^1.0.2", + "@rehooks/window-scroll-position": "^1.0.1", "@rehooks/window-size": "^1.0.2", "@svgr/webpack": "4.1.0", "@trailofbits/embark-contract-info": "^1.1.0", diff --git a/src/components/MainCointainer.jsx b/src/components/MainCointainer.jsx index ab7f5d8..4ee9e1c 100644 --- a/src/components/MainCointainer.jsx +++ b/src/components/MainCointainer.jsx @@ -1,5 +1,6 @@ import React,{ Suspense, lazy, useState, useEffect } from 'react'; import { Route, Link, Switch, withRouter } from 'react-router-dom' +import useWindowScrollPosition from '@rehooks/window-scroll-position' import PropTypes from 'prop-types'; import classNames from 'classnames'; import queryString from 'query-string' @@ -62,8 +63,11 @@ const useStyles = makeStyles(theme => ({ duration: theme.transitions.duration.enteringScreen, }), }, + appBarTop: { + boxShadow: 'none' + }, appBarBg: { - backgroundColor: '#fff' + backgroundColor: '#FAFAFA' }, accountText: { color: '#939BA1' @@ -150,6 +154,7 @@ function PersistentDrawerLeft({ loading, account, children, enableEthereum, loca const [open, setOpen] = useState(false) const [queryParams, setQueryParams] = useState({}) const [logs, setLogs] = useState([]) + const position = useWindowScrollPosition() useEffect(() => { const queryParams = queryString.parse(search) @@ -173,6 +178,7 @@ function PersistentDrawerLeft({ loading, account, children, enableEthereum, loca const classes = useStyles() const isHome = pathname === "/" + const popoverPosition = position.y < 100 return (