diff --git a/src/App.js b/src/App.js index 3485201e..d9a04632 100644 --- a/src/App.js +++ b/src/App.js @@ -79,14 +79,12 @@ const Main = () => { address = loginInfo && loginInfo.address; const page = location.pathname; - useEffect(() => { - if (page === "/dashboard/wallet") { - history.push("/#/dashboard/wallet"); - } else if (page === "/dashboard/staking") { - history.push("/#/dashboard/staking"); - } - trackPage(page); - }, [page]); + + if (page === "/dashboard/wallet") { + history.push("/#/dashboard/wallet"); + } else if (page === "/dashboard/staking") { + history.push("/#/dashboard/staking"); + } useEffect(() => { const fetchApi = async () => { diff --git a/src/containers/Common/MobileSidebar.js b/src/containers/Common/MobileSidebar.js index d9ef1b59..45705cd5 100644 --- a/src/containers/Common/MobileSidebar.js +++ b/src/containers/Common/MobileSidebar.js @@ -1,121 +1,126 @@ -import React from 'react'; -import SwipeableDrawer from '@material-ui/core/SwipeableDrawer'; -import Button from '@material-ui/core/Button'; -import List from '@material-ui/core/List'; -import Divider from '@material-ui/core/Divider'; -import MenuIcon from '@material-ui/icons/Menu'; -import {NavLink} from "react-router-dom"; +import React from "react"; +import SwipeableDrawer from "@material-ui/core/SwipeableDrawer"; +import Button from "@material-ui/core/Button"; +import List from "@material-ui/core/List"; +import Divider from "@material-ui/core/Divider"; +import MenuIcon from "@material-ui/icons/Menu"; +import { NavLink } from "react-router-dom"; import Icon from "../../components/Icon"; -import {useTranslation} from "react-i18next"; +import { useTranslation } from "react-i18next"; const EXPLORER_API = process.env.REACT_APP_EXPLORER_API; const MobileSidebar = () => { - const {t} = useTranslation(); - const [state, setState] = React.useState({ - top: false, - left: false, - bottom: false, - right: false, - }); + const { t } = useTranslation(); + const [state, setState] = React.useState({ + top: false, + left: false, + bottom: false, + right: false + }); - const toggleDrawer = (anchor, open) => (event) => { - if (event && event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) { - return; - } + const toggleDrawer = (anchor, open) => (event) => { + if ( + event && + event.type === "keydown" && + (event.key === "Tab" || event.key === "Shift") + ) { + return; + } - setState({...state, [anchor]: open}); - }; + setState({ ...state, [anchor]: open }); + }; - const list = (anchor) => ( -
- -
  • - -
    -
    - -
    -
    - {t("WALLET")} -
    -
  • -
  • - -
    -
    - -
    -
    - {t("STAKING")} -
    -
  • -
  • - -
    -
    - -
    -
    - {t("EXPLORER")} -
    - -
    -
    -
  • - -
  • - -
    -
    - -
    -
    - {t("HELP")} -
    -
  • + const list = (anchor) => ( +
    + +
  • + +
    +
    + +
    +
    + {t("WALLET")} +
    +
  • +
  • + +
    +
    + +
    +
    + {t("STAKING")} +
    +
  • +
  • + +
    +
    + +
    +
    + {t("EXPLORER")} +
    + +
    +
    +
  • -
    - -
    - ); +
  • + +
    +
    + +
    +
    + {t("HELP")} +
    +
  • +
    + +
    + ); - return ( -
    - - - - - {list('left')} - - -
    - ); + return ( +
    + + + + {list("left")} + + +
    + ); }; -export default MobileSidebar; \ No newline at end of file +export default MobileSidebar;