1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00

reset range slider on view switch

This commit is contained in:
Matthias Kretschmann 2020-10-14 16:02:26 +02:00
parent 056b6e6c2c
commit 2646e181cf
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -64,8 +64,8 @@ export default function Remove({
const [amountPercent, setAmountPercent] = useState('0')
const [amountMaxPercent, setAmountMaxPercent] = useState('100')
const [amountPoolShares, setAmountPoolShares] = useState('0')
const [amountOcean, setAmountOcean] = useState<string>()
const [amountDatatoken, setAmountDatatoken] = useState<string>()
const [amountOcean, setAmountOcean] = useState('0')
const [amountDatatoken, setAmountDatatoken] = useState('0')
const [isAdvanced, setIsAdvanced] = useState(false)
const [isLoading, setIsLoading] = useState<boolean>()
const [txId, setTxId] = useState<string>()
@ -116,6 +116,8 @@ export default function Remove({
setAmountPoolShares(`${amountPoolShares}`)
if (isAdvanced === true) {
setAmountMaxPercent('100')
const tokens = await ocean.pool.getTokensRemovedforPoolShares(
poolAddress,
`${amountPoolShares}`
@ -155,9 +157,11 @@ export default function Remove({
value={amountPercent}
onChange={handleAmountPercentChange}
/>
<span
className={styles.maximum}
>{`${amountMaxPercent}% max.`}</span>
{isAdvanced === false && (
<span
className={styles.maximum}
>{`${amountMaxPercent}% max.`}</span>
)}
</div>
<FormHelp>