diff --git a/src/components/organisms/AssetActions/Pool/Remove.tsx b/src/components/organisms/AssetActions/Pool/Remove.tsx index 1a1bdee60..27a57f7af 100644 --- a/src/components/organisms/AssetActions/Pool/Remove.tsx +++ b/src/components/organisms/AssetActions/Pool/Remove.tsx @@ -7,21 +7,21 @@ import Header from './Header' import { toast } from 'react-toastify' import Loader from '../../../atoms/Loader' import InputElement from '../../../atoms/Input/InputElement' - -// TODO: make it work, figure out maximumPoolShares +import Alert from '../../../atoms/Alert' export default function Remove({ setShowRemove, - poolAddress + poolAddress, + totalPoolTokens }: { setShowRemove: (show: boolean) => void poolAddress: string + totalPoolTokens: string }): ReactElement { const { ocean, accountId } = useOcean() const [amount, setAmount] = useState('') const [isLoading, setIsLoading] = useState() - - const maximumPoolShares = '?' + const [txId, setTxId] = useState('') async function handleRemoveLiquidity() { setIsLoading(true) @@ -31,9 +31,9 @@ export default function Remove({ accountId, poolAddress, amount, - maximumPoolShares + totalPoolTokens ) - console.log(result) + setTxId(result.transactionHash) } catch (error) { console.error(error.message) toast.error(error.message) @@ -80,6 +80,12 @@ export default function Remove({ Remove )} + {txId && ( + + )} ) diff --git a/src/components/organisms/AssetActions/Pool/index.tsx b/src/components/organisms/AssetActions/Pool/index.tsx index 0ad2df9f2..4728593a2 100644 --- a/src/components/organisms/AssetActions/Pool/index.tsx +++ b/src/components/organisms/AssetActions/Pool/index.tsx @@ -118,7 +118,11 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { totalBalance={totalBalance} /> ) : showRemove ? ( - + ) : ( <>