(Fix) Balances tabs fixs (#973)

* Fix cannot change safe from sidebar

* Removes collectibles header for 1.0.0 safes

* Removes exact path in balances route
This commit is contained in:
Agustin Pane 2020-06-01 13:50:45 -03:00 committed by GitHub
parent 4ddffaab76
commit 76eeb17dd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 37 deletions

View File

@ -111,47 +111,51 @@ const Balances = (props) => {
> >
Coins Coins
</NavLink> </NavLink>
<Divider className={assetDivider} /> {erc721Enabled ? (
<NavLink <>
to={`${SAFELIST_ADDRESS}/${address}/balances/collectibles`} <Divider className={assetDivider} />
activeClassName={assetTabActive} <NavLink
className={assetTab} to={`${SAFELIST_ADDRESS}/${address}/balances/collectibles`}
data-testid={'collectibles-assets-btn'} activeClassName={assetTabActive}
exact className={assetTab}
> data-testid={'collectibles-assets-btn'}
Collectibles exact
</NavLink> >
Collectibles
</NavLink>
</>
) : null}
</Col> </Col>
<Switch> <Switch>
<Route <Route
path={`${SAFELIST_ADDRESS}/${address}/balances/collectibles`} path={`${SAFELIST_ADDRESS}/${address}/balances/collectibles`}
exact exact
render={() => { render={() => {
return ( return !erc721Enabled ? (
<> <Redirect to={`${SAFELIST_ADDRESS}/${address}/balances`} />
<Col className={tokenControls} end="sm" sm={6} xs={12}> ) : (
<ButtonLink <Col className={tokenControls} end="sm" sm={6} xs={12}>
className={manageTokensButton} <ButtonLink
onClick={() => onShow('ManageCollectibleModal')} className={manageTokensButton}
size="lg" onClick={() => onShow('ManageCollectibleModal')}
testId="manage-tokens-btn" size="lg"
> testId="manage-tokens-btn"
Manage List >
</ButtonLink> Manage List
<Modal </ButtonLink>
description={'Enable and disable tokens to be listed'} <Modal
handleClose={() => onHide('ManageCollectibleModal')} description={'Enable and disable tokens to be listed'}
open={showManageCollectibleModal} handleClose={() => onHide('ManageCollectibleModal')}
title="Manage List" open={showManageCollectibleModal}
> title="Manage List"
<Tokens >
modalScreen={'assetsList'} <Tokens
onClose={() => onHide('ManageCollectibleModal')} modalScreen={'assetsList'}
safeAddress={address} onClose={() => onHide('ManageCollectibleModal')}
/> safeAddress={address}
</Modal> />
</Col> </Modal>
</> </Col>
) )
}} }}
/> />
@ -199,12 +203,10 @@ const Balances = (props) => {
/> />
<Route <Route
path={`${SAFELIST_ADDRESS}/${address}/balances`} path={`${SAFELIST_ADDRESS}/${address}/balances`}
exact
render={() => { render={() => {
return wrapInSuspense(<Coins showReceiveFunds={() => onShow('Receive')} showSendFunds={showSendFunds} />) return wrapInSuspense(<Coins showReceiveFunds={() => onShow('Receive')} showSendFunds={showSendFunds} />)
}} }}
/> />
<Redirect to={`${SAFELIST_ADDRESS}/${address}/balances`} />
</Switch> </Switch>
<SendModal <SendModal
activeScreenType="sendFunds" activeScreenType="sendFunds"