diff --git a/tauri-wallet/src/routes/balance.tsx b/tauri-wallet/src/routes/balance.tsx index c226537907..85e6b6cfff 100644 --- a/tauri-wallet/src/routes/balance.tsx +++ b/tauri-wallet/src/routes/balance.tsx @@ -6,6 +6,7 @@ import { NoClientError } from '../components/NoClientError' import { Confirmation } from '../components/Confirmation' import { ClientContext } from '../context/main' import { Alert } from '@material-ui/lab' +import { theme } from '../theme' export const Balance = () => { const { client } = useContext(ClientContext) @@ -25,6 +26,7 @@ export const Balance = () => { SuccessMessage={ { } > - {'The current balance is ' + client.balance} + {'The current wallet balance is ' + client.balance} } failureMessage="Failed to check the account balance!" diff --git a/tauri-wallet/src/routes/bond/BondForm.tsx b/tauri-wallet/src/routes/bond/BondForm.tsx index 1fd8ecc222..322a9856ea 100644 --- a/tauri-wallet/src/routes/bond/BondForm.tsx +++ b/tauri-wallet/src/routes/bond/BondForm.tsx @@ -25,7 +25,7 @@ export const BondNodeForm = () => { return (
-
+
( @@ -28,13 +30,13 @@ export const Routes = () => ( - + - + diff --git a/tauri-wallet/src/routes/unbond.tsx b/tauri-wallet/src/routes/unbond.tsx deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tauri-wallet/src/routes/unbond/UnbondForm.tsx b/tauri-wallet/src/routes/unbond/UnbondForm.tsx new file mode 100644 index 0000000000..10fa86a8ca --- /dev/null +++ b/tauri-wallet/src/routes/unbond/UnbondForm.tsx @@ -0,0 +1,34 @@ +import React, { useState } from 'react' +import { Alert } from '@material-ui/lab' +import { Button, Theme } from '@material-ui/core' +import { useTheme } from '@material-ui/styles' + +export const UnbondForm = () => { + const theme: Theme = useTheme() + return ( +
+ + You don't currently have a bonded node + +
+ +
+
+ ) +} diff --git a/tauri-wallet/src/routes/unbond/index.tsx b/tauri-wallet/src/routes/unbond/index.tsx new file mode 100644 index 0000000000..2333437b57 --- /dev/null +++ b/tauri-wallet/src/routes/unbond/index.tsx @@ -0,0 +1,19 @@ +import React from 'react' +import { Layout, NymCard, Page } from '../../components' +import { UnbondForm } from './UnbondForm' + +export const Unbond = () => { + return ( + + + + + + + + ) +} diff --git a/tauri-wallet/src/routes/undelegate.tsx b/tauri-wallet/src/routes/undelegate.tsx deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx b/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx new file mode 100644 index 0000000000..ca2c8e9557 --- /dev/null +++ b/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx @@ -0,0 +1,100 @@ +import React, { useState } from 'react' +import { Alert } from '@material-ui/lab' +import { Button, Grid, TextField, Theme } from '@material-ui/core' +import { useGetBalance } from '../../hooks/useGetBalance' +import { NodeTypeSelector } from '../../components/NodeTypeSelector' +import { EnumNodeType } from '../../types/global' +import { useTheme } from '@material-ui/styles' + +export const UndelegateForm = () => { + const [isValidAmount, setIsValidAmount] = useState(true) + const [validIdentity, setValidIdentity] = useState(true) + const [allocationWarning, setAllocationWarning] = useState() + const [nodeType, setNodeType] = useState(EnumNodeType.Mixnode) + + const { getBalance, accountBalance } = useGetBalance() + const theme: Theme = useTheme() + + const handleAmountChange = (event: any) => { + // don't ask me about that. javascript works in mysterious ways + // and this is apparently a good way of checking if string + // is purely made of numeric characters + const parsed = +event.target.value + + if (isNaN(parsed)) { + setIsValidAmount(false) + } else { + try { + const allocationCheck = { error: undefined, message: '' } + if (allocationCheck.error) { + setAllocationWarning(allocationCheck.message) + setIsValidAmount(false) + } else { + setAllocationWarning(allocationCheck.message) + setIsValidAmount(true) + } + } catch { + setIsValidAmount(false) + } + } + } + + return ( + {}}> +
+ + + setNodeType(nodeType)} + /> + + + + + + {allocationWarning && ( + + + {allocationWarning} + + + )} + +
+
+ +
+ + ) +} diff --git a/tauri-wallet/src/routes/undelegate/index.tsx b/tauri-wallet/src/routes/undelegate/index.tsx new file mode 100644 index 0000000000..80dbf5161b --- /dev/null +++ b/tauri-wallet/src/routes/undelegate/index.tsx @@ -0,0 +1,19 @@ +import React from 'react' +import { Layout, NymCard, Page } from '../../components' +import { UndelegateForm } from './UndelegateForm' + +export const Undelegate = () => { + return ( + + + + + + + + ) +}