diff --git a/nym-wallet/src/pages/bond/BondForm.tsx b/nym-wallet/src/pages/bond/BondForm.tsx
index 55609d15fc..314088cb88 100644
--- a/nym-wallet/src/pages/bond/BondForm.tsx
+++ b/nym-wallet/src/pages/bond/BondForm.tsx
@@ -20,6 +20,7 @@ import { validationSchema } from './validationSchema'
import { Coin, Gateway, MixNode } from '../../types'
import { ClientContext, MAJOR_CURRENCY } from '../../context/main'
import { checkHasEnoughFunds } from '../../utils'
+import { Fee } from '../../components'
type TBondFormFields = {
withAdvancedOptions: boolean
@@ -78,12 +79,10 @@ const formatData = (data: TBondFormFields) => {
export const BondForm = ({
disabled,
- fees,
onError,
onSuccess,
}: {
disabled: boolean
- fees?: { [EnumNodeType.mixnode]: Coin; [EnumNodeType.gateway]?: Coin }
onError: (message?: string) => void
onSuccess: (details: { address: string; amount: string }) => void
}) => {
@@ -99,7 +98,7 @@ export const BondForm = ({
defaultValues,
})
- const { userBalance } = useContext(ClientContext)
+ const { userBalance, getBondDetails } = useContext(ClientContext)
const watchNodeType = watch('nodeType', defaultValues.nodeType)
const watchAdvancedOptions = watch('withAdvancedOptions', defaultValues.withAdvancedOptions)
@@ -114,7 +113,8 @@ export const BondForm = ({
const pledge = await majorToMinor(data.amount)
await bond({ type: data.nodeType, ownerSignature: data.ownerSignature, data: formattedData, pledge })
- .then(() => {
+ .then(async () => {
+ await getBondDetails()
userBalance.fetchBalance()
onSuccess({ address: data.identityKey, amount: data.amount })
})
@@ -358,28 +358,19 @@ export const BondForm = ({
)}
>
)}
- {fees && (
-
-
- {' '}
- {`Bonding fee: ${
- watchNodeType === EnumNodeType.mixnode ? fees.mixnode.amount : fees?.gateway?.amount
- } ${MAJOR_CURRENCY}`}
-
-
- )}
`1px solid ${theme.palette.grey[200]}`,
bgcolor: 'grey.100',
padding: 2,
}}
>
+ {!disabled ? : }
@@ -159,16 +157,21 @@ const DataField = ({ title, info, Indicator }: { title: string; info: string; In
)
-const PercentIndicator = ({ value }: { value: number }) => {
+const PercentIndicator = ({ value, warning }: { value: number; warning?: boolean }) => {
return (
-
+
{value}%
-
+
)
diff --git a/nym-wallet/src/pages/unbond/index.tsx b/nym-wallet/src/pages/unbond/index.tsx
index 53291a39a6..53a3e4b0e6 100644
--- a/nym-wallet/src/pages/unbond/index.tsx
+++ b/nym-wallet/src/pages/unbond/index.tsx
@@ -9,7 +9,7 @@ import { unbond } from '../../requests'
export const Unbond = () => {
const [isLoading, setIsLoading] = useState(false)
const { checkOwnership, ownership } = useCheckOwnership()
- const { userBalance } = useContext(ClientContext)
+ const { userBalance, getBondDetails } = useContext(ClientContext)
useEffect(() => {
const initialiseForm = async () => {
@@ -33,6 +33,7 @@ export const Unbond = () => {
setIsLoading(true)
await unbond(ownership.nodeType)
await userBalance.fetchBalance()
+ await getBondDetails()
await checkOwnership()
setIsLoading(false)
}}
diff --git a/nym-wallet/src/types/global.ts b/nym-wallet/src/types/global.ts
index 9523163a44..4d15f8214d 100644
--- a/nym-wallet/src/types/global.ts
+++ b/nym-wallet/src/types/global.ts
@@ -7,7 +7,7 @@ export enum EnumNodeType {
export type TNodeOwnership = {
hasOwnership: boolean
- nodeType: EnumNodeType
+ nodeType?: EnumNodeType
}
export type TClientDetails = {