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