From b97ba5ea2850ce2930e5ef91eb06d54b86c9c141 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Wed, 21 Aug 2019 17:46:23 -0400 Subject: [PATCH] don't display title at home --- src/components/MainCointainer.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/MainCointainer.jsx b/src/components/MainCointainer.jsx index 18cf786..793d46f 100644 --- a/src/components/MainCointainer.jsx +++ b/src/components/MainCointainer.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Route, Link, Switch } from 'react-router-dom' +import { Route, Link, Switch, withRouter } from 'react-router-dom' import PropTypes from 'prop-types'; import classNames from 'classnames'; import { withStyles } from '@material-ui/core/styles'; @@ -150,8 +150,9 @@ class PersistentDrawerLeft extends React.Component { }; render() { - const { classes, theme, loading, account, enableEthereum } = this.props + const { classes, theme, loading, account, enableEthereum, location: { pathname } } = this.props const { open } = this.state + const isHome = pathname === "/" return (
@@ -178,9 +179,9 @@ class PersistentDrawerLeft extends React.Component { />} {!loading && } - + {!isHome && Liquid Funding - + } {!!account &&
{formatAccount(account)}
@@ -252,7 +253,9 @@ PersistentDrawerLeft.propTypes = { theme: PropTypes.object.isRequired, loading: PropTypes.bool.isRequired, account: PropTypes.string, - enableEthereum: PropTypes.func.isRequired + enableEthereum: PropTypes.func.isRequired, + location: PropTypes.object }; -export default withStyles(styles, { withTheme: true })(PersistentDrawerLeft) +const DrawerWithRouter = withRouter(PersistentDrawerLeft) +export default withStyles(styles, { withTheme: true })(DrawerWithRouter)