Skip to content

Commit

Permalink
[DDW-694] Fix: Buttons missing in Tokens footer (#2703)
Browse files Browse the repository at this point in the history
* [DDW-694] Fix: Added buttons as dependency in useMemo

* [DDW-694] updated CHANGELOG

* Revert 3fb7d98

* Revert "Revert 3fb7d98"

This reverts commit 0683b5b.

* Revert "Revert 3fb7d98"

This reverts commit 64f5ca5

* [DDW-694] Added more dependencies to header function

* [DDW-694] Updates CHANGELOG

Co-authored-by: Danilo Prates <daniloprates@gmail.com>
Co-authored-by: Nikola Glumac <niglumac@gmail.com>
  • Loading branch information
3 people committed Oct 12, 2021
1 parent e69fa22 commit 1356993
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -4,7 +4,7 @@

### Features

- Implemented the wallet Tokens dedicated screen ([PR 2671](https://github.com/input-output-hk/daedalus/pull/2671), [PR 2701](https://github.com/input-output-hk/daedalus/pull/2701))
- Implemented the wallet Tokens dedicated screen ([PR 2671](https://github.com/input-output-hk/daedalus/pull/2671), [PR 2701](https://github.com/input-output-hk/daedalus/pull/2701), [PR 2703](https://github.com/input-output-hk/daedalus/pull/2703))

### Fixes

Expand Down
51 changes: 29 additions & 22 deletions source/renderer/app/components/wallet/tokens/WalletToken.js
Expand Up @@ -157,28 +157,14 @@ const WalletToken = observer((props: Props) => {
<SVGInline svg={arrow} className={arrowStyles} />
</div>
);
}, [asset, isExpanded, arrowStyles]);

const footer = useMemo(() => {
return (
<div className={styles.footer}>
<dl>
<dt>{intl.formatMessage(messages.amountLabel)}</dt>
<dd>
{' '}
<AssetAmount
amount={asset.quantity}
metadata={asset.metadata}
decimals={asset.decimals}
isLoading={isLoading}
className={styles.assetAmount}
/>
</dd>
</dl>
{buttons}
</div>
);
}, [asset, isLoading, intl]);
}, [
asset,
isExpanded,
arrowStyles,
onToggleFavorite,
isFavorite,
favoriteIconStyles,
]);

const buttons = useMemo(() => {
const { recommendedDecimals, decimals } = asset;
Expand Down Expand Up @@ -235,6 +221,27 @@ const WalletToken = observer((props: Props) => {
);
}, [asset, onOpenAssetSend, onAssetSettings, intl]);

const footer = useMemo(() => {
return (
<div className={styles.footer}>
<dl>
<dt>{intl.formatMessage(messages.amountLabel)}</dt>
<dd>
{' '}
<AssetAmount
amount={asset.quantity}
metadata={asset.metadata}
decimals={asset.decimals}
isLoading={isLoading}
className={styles.assetAmount}
/>
</dd>
</dl>
{buttons}
</div>
);
}, [asset, isLoading, intl, buttons]);

const { isInsertingAsset, isRemovingAsset } = props;
const componentStyles = classNames(styles.component, {
[styles.isExpanded]: isExpanded,
Expand Down

0 comments on commit 1356993

Please sign in to comment.