From a9aeed4aecb5e1d5d166e21c3adff8b9363b4012 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 26 Jan 2022 12:41:21 +0000 Subject: [PATCH] define token address & symbol only once --- .../Asset/AssetActions/Pool/Actions.tsx | 15 +++++-------- .../Asset/AssetActions/Pool/Add/index.tsx | 22 +++++++++++++------ .../Asset/AssetActions/Pool/Remove.tsx | 18 ++++++++------- .../Asset/AssetActions/Pool/index.tsx | 7 +++--- .../Asset/AssetActions/Trade/FormTrade.tsx | 6 ++++- 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/components/Asset/AssetActions/Pool/Actions.tsx b/src/components/Asset/AssetActions/Pool/Actions.tsx index 83791e69c..522c92e0a 100644 --- a/src/components/Asset/AssetActions/Pool/Actions.tsx +++ b/src/components/Asset/AssetActions/Pool/Actions.tsx @@ -6,8 +6,6 @@ import ExplorerLink from '@shared/ExplorerLink' import SuccessConfetti from '@shared/SuccessConfetti' import { useWeb3 } from '@context/Web3' import TokenApproval from '@shared/TokenApproval' -import { getOceanConfig } from '@utils/ocean' -import { useAsset } from '@context/Asset' export default function Actions({ isLoading, @@ -16,9 +14,10 @@ export default function Actions({ txId, actionName, amount, - coin, action, - isDisabled + isDisabled, + tokenAddress, + tokenSymbol }: { isLoading: boolean loaderMessage: string @@ -26,12 +25,12 @@ export default function Actions({ txId: string actionName: string amount?: string - coin?: string action: () => void isDisabled?: boolean + tokenAddress: string + tokenSymbol: string }): ReactElement { const { networkId } = useWeb3() - const { ddo } = useAsset() const actionButton = (