cart icon hidden if url no sho

This commit is contained in:
enggar_ganteng 2019-01-05 23:07:59 +07:00
parent 296795147d
commit 70186acf0f

View File

@ -457,52 +457,17 @@ export default class App extends React.Component {
</div> </div>
</div> </div>
<IconMenu {window.location.pathname.split("/")[2] == "shop" ? (
<IconMenu
anchorOrigin={{vertical: 'bottom', horizontal: 'right'}} anchorOrigin={{vertical: 'bottom', horizontal: 'right'}}
targetOrigin={{vertical: 'top', horizontal: 'right'}} targetOrigin={{vertical: 'top', horizontal: 'right'}}
onClick={() => this.notificationStore.readAll()} onClick={() => this.notificationStore.readAll()}
iconButtonElement={ iconButtonElement={
<div> <div>
{userData.role === 'admin' ? (
<div>
{this.notificationStore.unread_notif === 0 ?
<IconButton className="menuAkunItem" tooltip="Cart center" <IconButton className="menuAkunItem" tooltip="Cart center"
tooltipPosition="bottom-center"> tooltipPosition="bottom-center">
<ShoppingCart/> <ShoppingCart/>
</IconButton> : </IconButton>
<Badge
badgeContent={this.notificationStore.unread_notif}
primary={true}
badgeStyle={{top: 15, right: 12}}
>
<IconButton className="menuAkunItem" tooltip="Cart center"
tooltipPosition="bottom-center">
<ShoppingCart/>
</IconButton>
</Badge>
}
</div>
) : (
<div>
{this.notificationStore.unread_notif === 0 ?
<IconButton className="menuAkunItem" tooltip="Cart center"
tooltipPosition="bottom-center">
<ShoppingCart/>
</IconButton> :
<Badge
badgeContent={this.notificationStore.unread_notif}
primary={true}
badgeStyle={{top: 15, right: 12}}
>
<IconButton className="menuAkunItem" tooltip="Cart center"
tooltipPosition="bottom-center">
<ShoppingCart/>
</IconButton>
</Badge>
}
</div>
)}
</div> </div>
} }
> >
@ -542,6 +507,8 @@ export default class App extends React.Component {
</Link> </Link>
</List> </List>
</IconMenu> </IconMenu>
) : (<div/>)}
<IconMenu <IconMenu
anchorOrigin={{vertical: 'bottom', horizontal: 'right'}} anchorOrigin={{vertical: 'bottom', horizontal: 'right'}}