Skip to content

Commit 1356993

Browse files
danielmainthedanhellernikolaglumac
authored
[DDW-694] Fix: Buttons missing in Tokens footer (#2703)
* [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 <[email protected]> Co-authored-by: Nikola Glumac <[email protected]>
1 parent e69fa22 commit 1356993

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Features
66

7-
- 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))
7+
- 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))
88

99
### Fixes
1010

source/renderer/app/components/wallet/tokens/WalletToken.js

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -157,28 +157,14 @@ const WalletToken = observer((props: Props) => {
157157
<SVGInline svg={arrow} className={arrowStyles} />
158158
</div>
159159
);
160-
}, [asset, isExpanded, arrowStyles]);
161-
162-
const footer = useMemo(() => {
163-
return (
164-
<div className={styles.footer}>
165-
<dl>
166-
<dt>{intl.formatMessage(messages.amountLabel)}</dt>
167-
<dd>
168-
{' '}
169-
<AssetAmount
170-
amount={asset.quantity}
171-
metadata={asset.metadata}
172-
decimals={asset.decimals}
173-
isLoading={isLoading}
174-
className={styles.assetAmount}
175-
/>
176-
</dd>
177-
</dl>
178-
{buttons}
179-
</div>
180-
);
181-
}, [asset, isLoading, intl]);
160+
}, [
161+
asset,
162+
isExpanded,
163+
arrowStyles,
164+
onToggleFavorite,
165+
isFavorite,
166+
favoriteIconStyles,
167+
]);
182168

183169
const buttons = useMemo(() => {
184170
const { recommendedDecimals, decimals } = asset;
@@ -235,6 +221,27 @@ const WalletToken = observer((props: Props) => {
235221
);
236222
}, [asset, onOpenAssetSend, onAssetSettings, intl]);
237223

224+
const footer = useMemo(() => {
225+
return (
226+
<div className={styles.footer}>
227+
<dl>
228+
<dt>{intl.formatMessage(messages.amountLabel)}</dt>
229+
<dd>
230+
{' '}
231+
<AssetAmount
232+
amount={asset.quantity}
233+
metadata={asset.metadata}
234+
decimals={asset.decimals}
235+
isLoading={isLoading}
236+
className={styles.assetAmount}
237+
/>
238+
</dd>
239+
</dl>
240+
{buttons}
241+
</div>
242+
);
243+
}, [asset, isLoading, intl, buttons]);
244+
238245
const { isInsertingAsset, isRemovingAsset } = props;
239246
const componentStyles = classNames(styles.component, {
240247
[styles.isExpanded]: isExpanded,

0 commit comments

Comments
 (0)