diff --git a/src/components/molecules/CardInstance/index.tsx b/src/components/molecules/CardInstance/index.tsx index 731a0f4..8b5c64e 100644 --- a/src/components/molecules/CardInstance/index.tsx +++ b/src/components/molecules/CardInstance/index.tsx @@ -31,7 +31,7 @@ interface CardInstanceInterface { accountId: string, instance: ServerListProps, ) => Promise; - onWithdrawReward?: (accountId: string) => Promise; + onWithdrawReward?: (accountId: string, instanceId: number) => Promise; type: InstanceType; } diff --git a/src/components/molecules/Staked/Deregister.tsx b/src/components/molecules/Staked/Deregister.tsx index f70473d..486c194 100644 --- a/src/components/molecules/Staked/Deregister.tsx +++ b/src/components/molecules/Staked/Deregister.tsx @@ -7,6 +7,7 @@ import CardStaked from '../../atoms/CardStaked'; import ModalComponent from '../Modal'; import { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; import { PolkadotAccountList } from '../PolkadotAccountList'; +import { BN_ZERO } from '@polkadot/util'; interface DeregisterProps { instance: ServerListProps; @@ -81,7 +82,9 @@ export const Deregister = (props: DeregisterProps) => { onClick={handleOpenModal} label={ Boolean(instance.unstakedAt) - ? 'Waiting To Unstaked' + ? instance.stakedAmount.lte(BN_ZERO) + ? 'Unstaked' + : 'Waiting for Unstaked' : 'De-Register Instance' } isFullWidth diff --git a/src/components/molecules/Staked/TotalStaked.tsx b/src/components/molecules/Staked/TotalStaked.tsx index 18560d8..7e6257d 100644 --- a/src/components/molecules/Staked/TotalStaked.tsx +++ b/src/components/molecules/Staked/TotalStaked.tsx @@ -85,11 +85,8 @@ export const TotalStaked = (props: TotalStakedProps) => { let fixedValue = Number(inputValue[0]).toLocaleString() + inputDecimal; if (inputValue[1]?.length > 10) return; - console.log(fixedValue); - const valueDecimal = inputValue[1]?.length ?? 0; const updatedDecimal = new BN((10 ** (18 - valueDecimal)).toString()); - console.log(+updatedDecimal); let value = +fixedValue.replace(/,/gi, '').replace(/\./gi, ''); if (+value >= 100000 * 10 ** valueDecimal) { value = 100000 * 10 ** valueDecimal; @@ -214,7 +211,11 @@ export const TotalStaked = (props: TotalStakedProps) => {