From 2673f83116a95d369023bc863b00178acdcbb326 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 27 Jul 2021 15:08:37 +0100 Subject: [PATCH 01/11] fix bug --- wallet-web/components/undelegate/NodeUndelegation.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wallet-web/components/undelegate/NodeUndelegation.tsx b/wallet-web/components/undelegate/NodeUndelegation.tsx index c04aa1464d..34666e48e0 100644 --- a/wallet-web/components/undelegate/NodeUndelegation.tsx +++ b/wallet-web/components/undelegate/NodeUndelegation.tsx @@ -65,7 +65,7 @@ const UndelegateFromNode = () => { } // we haven't clicked undelegate button yet - if (!undelegationStarted) { + if (!isLoading) { return ( @@ -95,9 +95,9 @@ const UndelegateFromNode = () => { Undelegate stake from {nodeType} From 721e4bda8be95f7fe94fcbbb643dc6940289fbdd Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 27 Jul 2021 16:40:15 +0100 Subject: [PATCH 02/11] create reuseable components --- wallet-web/components/Layout.tsx | 20 ++++++++++++++++++++ wallet-web/components/NymCard.tsx | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 wallet-web/components/Layout.tsx create mode 100644 wallet-web/components/NymCard.tsx diff --git a/wallet-web/components/Layout.tsx b/wallet-web/components/Layout.tsx new file mode 100644 index 0000000000..4200d6ab88 --- /dev/null +++ b/wallet-web/components/Layout.tsx @@ -0,0 +1,20 @@ +import React from 'react' +import { Grid, Theme, useTheme, useMediaQuery } from '@material-ui/core' + +export const Layout = ({ children }: { children: React.ReactElement }) => { + const theme: Theme = useTheme() + + return ( +
+ + + {children} + + +
+ ) +} diff --git a/wallet-web/components/NymCard.tsx b/wallet-web/components/NymCard.tsx new file mode 100644 index 0000000000..a47d114832 --- /dev/null +++ b/wallet-web/components/NymCard.tsx @@ -0,0 +1,30 @@ +import React from 'react' +import { Card, CardContent, CardHeader, useTheme } from '@material-ui/core' + +export const NymCard = ({ + title, + subheader, + children, +}: { + title: string + subheader?: string + children: React.ReactElement +}) => { + const theme = useTheme() + return ( + + + + {children} + + + ) +} From 5dc67b995e135be1d1792cb38292f5c042e77e96 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 27 Jul 2021 16:41:35 +0100 Subject: [PATCH 03/11] export new reusable components --- wallet-web/components/index.ts | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 wallet-web/components/index.ts diff --git a/wallet-web/components/index.ts b/wallet-web/components/index.ts new file mode 100644 index 0000000000..a473532ff7 --- /dev/null +++ b/wallet-web/components/index.ts @@ -0,0 +1,2 @@ +export * from './NymCard' +export * from './Layout' From aa048cabe62ebcf54007578f98814281d576559a Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 27 Jul 2021 16:44:11 +0100 Subject: [PATCH 04/11] update pages to use new components --- wallet-web/components/MainNav.tsx | 305 +++++++++--------- wallet-web/components/bond/NodeBond.tsx | 16 +- .../components/delegate/NodeDelegation.tsx | 16 +- .../delegation-check/DelegationCheck.tsx | 20 +- wallet-web/components/unbond/UnbondNode.tsx | 16 +- .../undelegate/NodeUndelegation.tsx | 16 +- wallet-web/pages/balanceCheck.tsx | 78 +---- wallet-web/pages/bond.tsx | 25 +- wallet-web/pages/checkDelegation.tsx | 28 +- wallet-web/pages/delegateStake.tsx | 25 +- wallet-web/pages/receive.tsx | 13 + wallet-web/pages/send.tsx | 85 ++--- wallet-web/pages/unbond.tsx | 25 +- wallet-web/pages/undelegateStake.tsx | 28 +- 14 files changed, 298 insertions(+), 398 deletions(-) create mode 100644 wallet-web/pages/receive.tsx diff --git a/wallet-web/components/MainNav.tsx b/wallet-web/components/MainNav.tsx index 65f29f2bab..5e4fb5c031 100644 --- a/wallet-web/components/MainNav.tsx +++ b/wallet-web/components/MainNav.tsx @@ -1,172 +1,183 @@ import { - AppBar, - Divider, - Drawer, - IconButton, - List, - ListItem, - ListItemIcon, - ListItemText, - ListSubheader, - Toolbar, - Typography -} from "@material-ui/core"; -import React, { useContext } from "react"; + AppBar, + Divider, + Drawer, + IconButton, + List, + ListItem, + ListItemIcon, + ListItemText, + ListSubheader, + Toolbar, + Typography, +} from '@material-ui/core' +import React, { useContext } from 'react' import Link from 'next/link' -import VpnKeyIcon from "@material-ui/icons/VpnKey" -import AccountBalanceWalletIcon from '@material-ui/icons/AccountBalanceWallet'; -import { ValidatorClientContext } from "../contexts/ValidatorClient"; -import { ADMIN_ADDRESS } from "../pages/_app"; -import MenuIcon from '@material-ui/icons/Menu'; -import MonetizationOnIcon from '@material-ui/icons/MonetizationOn'; -import AttachMoneyIcon from '@material-ui/icons/AttachMoney'; -import MoneyOffIcon from '@material-ui/icons/MoneyOff'; -import HowToVoteIcon from '@material-ui/icons/HowToVote'; -import CancelIcon from '@material-ui/icons/Cancel'; -import PageviewIcon from '@material-ui/icons/Pageview'; -import { makeBasicStyle } from "../common/helpers"; -import { theme } from "../lib/theme"; +import VpnKeyIcon from '@material-ui/icons/VpnKey' +import AccountBalanceWalletIcon from '@material-ui/icons/AccountBalanceWallet' +import { ValidatorClientContext } from '../contexts/ValidatorClient' +import { ADMIN_ADDRESS } from '../pages/_app' +import MenuIcon from '@material-ui/icons/Menu' +import MonetizationOnIcon from '@material-ui/icons/MonetizationOn' +import AttachMoneyIcon from '@material-ui/icons/AttachMoney' +import MoneyOffIcon from '@material-ui/icons/MoneyOff' +import HowToVoteIcon from '@material-ui/icons/HowToVote' +import CancelIcon from '@material-ui/icons/Cancel' +import PageviewIcon from '@material-ui/icons/Pageview' +import { makeBasicStyle } from '../common/helpers' +import { theme } from '../lib/theme' export default function MainNav() { - const classes = makeBasicStyle(theme); + const classes = makeBasicStyle(theme) - const { client } = useContext(ValidatorClientContext) + const { client } = useContext(ValidatorClientContext) - let adminPageDisplayed = false + let adminPageDisplayed = false - if (client !== null && client.address === ADMIN_ADDRESS) { - adminPageDisplayed = true - } + if (client !== null && client.address === ADMIN_ADDRESS) { + adminPageDisplayed = true + } - const [open, setOpen] = React.useState(false) + const [open, setOpen] = React.useState(false) + const toggleDrawer = () => { + setOpen((prevOpen) => !prevOpen) + } - const toggleDrawer = () => { - setOpen((prevOpen) => !prevOpen); - }; + const closeDrawer = () => { + setOpen(false) + } - const closeDrawer = () => { - setOpen(false) - } + return ( + <> + + + + + - return ( - - - - - - + +
+ Nym Wallet + } + > + - -
- - Nym Wallet - - } - > - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - + - {/**/} - {/* */} - {/**/} + {/**/} + {/* */} + {/**/} - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - {adminPageDisplayed && - - - - - - + {adminPageDisplayed && ( + <> + + + + + - - - - - - } - -
-
+ + + + + + )} +
+
+
- - - Nym - -
-
-
- ) -} \ No newline at end of file + + Nym + +
+
+ + ) +} diff --git a/wallet-web/components/bond/NodeBond.tsx b/wallet-web/components/bond/NodeBond.tsx index 3e14c4eaaa..57e27139c6 100644 --- a/wallet-web/components/bond/NodeBond.tsx +++ b/wallet-web/components/bond/NodeBond.tsx @@ -162,20 +162,8 @@ const BondNode = () => { return ( <> -
- - - - Bond a {nodeType} - - {getBondContent()} - -
+ + {getBondContent()} ) } diff --git a/wallet-web/components/delegate/NodeDelegation.tsx b/wallet-web/components/delegate/NodeDelegation.tsx index 92f7426939..6d50d54fad 100644 --- a/wallet-web/components/delegate/NodeDelegation.tsx +++ b/wallet-web/components/delegate/NodeDelegation.tsx @@ -102,20 +102,8 @@ const DelegateToNode = () => { return ( <> -
- - - - Delegate to {nodeType} - - {getDelegationContent()} - -
+ + {getDelegationContent()} ) } diff --git a/wallet-web/components/delegation-check/DelegationCheck.tsx b/wallet-web/components/delegation-check/DelegationCheck.tsx index db590eb710..c9805c6294 100644 --- a/wallet-web/components/delegation-check/DelegationCheck.tsx +++ b/wallet-web/components/delegation-check/DelegationCheck.tsx @@ -88,7 +88,7 @@ const DelegationCheck = () => { ) @@ -107,23 +107,7 @@ const DelegationCheck = () => { ) } - return ( - <> -
- - - Check your stake on a {nodeType} - - {getDelegationCheckContent()} - -
- - ) + return <>{getDelegationCheckContent()} } export default DelegationCheck diff --git a/wallet-web/components/unbond/UnbondNode.tsx b/wallet-web/components/unbond/UnbondNode.tsx index 81d8cd7fe7..a7634bbf2c 100644 --- a/wallet-web/components/unbond/UnbondNode.tsx +++ b/wallet-web/components/unbond/UnbondNode.tsx @@ -127,20 +127,8 @@ const UnbondNode = () => { return ( <> -
- - - - Unbond a {headerText} - - {getUnbondContent()} - -
+ + {getUnbondContent()} ) } diff --git a/wallet-web/components/undelegate/NodeUndelegation.tsx b/wallet-web/components/undelegate/NodeUndelegation.tsx index 34666e48e0..8ca1d13372 100644 --- a/wallet-web/components/undelegate/NodeUndelegation.tsx +++ b/wallet-web/components/undelegate/NodeUndelegation.tsx @@ -91,20 +91,8 @@ const UndelegateFromNode = () => { return ( <> -
- - - - Undelegate stake from {nodeType} - - {getUndelegationContent()} - -
+ + {getUndelegationContent()} ) } diff --git a/wallet-web/pages/balanceCheck.tsx b/wallet-web/pages/balanceCheck.tsx index 7ac365a668..4f3e8f3e8c 100644 --- a/wallet-web/pages/balanceCheck.tsx +++ b/wallet-web/pages/balanceCheck.tsx @@ -1,52 +1,15 @@ import React, { useContext, useEffect } from 'react' -import Paper from '@material-ui/core/Paper' -import Typography from '@material-ui/core/Typography' import Button from '@material-ui/core/Button' import RefreshIcon from '@material-ui/icons/Refresh' -import { makeStyles } from '@material-ui/core/styles' import { useRouter } from 'next/router' import { ValidatorClientContext } from '../contexts/ValidatorClient' import MainNav from '../components/MainNav' import Confirmation from '../components/Confirmation' import NoClientError from '../components/NoClientError' import { useGetBalance } from '../hooks/useGetBalance' - -const useStyles = makeStyles((theme) => ({ - appBar: { - position: 'relative', - }, - layout: { - width: 'auto', - marginLeft: theme.spacing(2), - marginRight: theme.spacing(2), - [theme.breakpoints.up(600 + theme.spacing(2) * 2)]: { - width: 600, - marginLeft: 'auto', - marginRight: 'auto', - }, - }, - paper: { - marginTop: theme.spacing(3), - marginBottom: theme.spacing(3), - padding: theme.spacing(2), - [theme.breakpoints.up(600 + theme.spacing(3) * 2)]: { - marginTop: theme.spacing(6), - marginBottom: theme.spacing(6), - padding: theme.spacing(3), - }, - }, - buttons: { - display: 'flex', - justifyContent: 'flex-end', - }, - button: { - marginTop: theme.spacing(3), - marginLeft: theme.spacing(1), - }, -})) +import { Layout, NymCard } from '../components' export default function CheckBalance() { - const classes = useStyles() const router = useRouter() const { client } = useContext(ValidatorClientContext) @@ -69,12 +32,8 @@ export default function CheckBalance() { return ( <> -
- - - Check Balance - - + + {client === null ? ( ) : ( @@ -82,27 +41,24 @@ export default function CheckBalance() { -
- -
+ )} -
-
+ + ) } diff --git a/wallet-web/pages/bond.tsx b/wallet-web/pages/bond.tsx index ecb98778e8..f7d8573a9f 100644 --- a/wallet-web/pages/bond.tsx +++ b/wallet-web/pages/bond.tsx @@ -1,14 +1,19 @@ -import React from "react"; -import MainNav from "../components/MainNav"; -import BondNode from "../components/bond/NodeBond"; +import React from 'react' +import MainNav from '../components/MainNav' +import BondNode from '../components/bond/NodeBond' +import { Layout, NymCard } from '../components' const Bond = () => { - return ( - - - - - ); + return ( + <> + + + + + + + + ) } -export default Bond \ No newline at end of file +export default Bond diff --git a/wallet-web/pages/checkDelegation.tsx b/wallet-web/pages/checkDelegation.tsx index f3606a135f..2d592a106a 100644 --- a/wallet-web/pages/checkDelegation.tsx +++ b/wallet-web/pages/checkDelegation.tsx @@ -1,14 +1,22 @@ -import React from "react"; -import MainNav from "../components/MainNav"; -import DelegationCheck from "../components/delegation-check/DelegationCheck"; +import React from 'react' +import MainNav from '../components/MainNav' +import DelegationCheck from '../components/delegation-check/DelegationCheck' +import { Layout, NymCard } from '../components' const CheckDelegation = () => { - return ( - - - - - ); + return ( + <> + + + + + + + + ) } -export default CheckDelegation \ No newline at end of file +export default CheckDelegation diff --git a/wallet-web/pages/delegateStake.tsx b/wallet-web/pages/delegateStake.tsx index 3eed5c30ca..f2e69c013e 100644 --- a/wallet-web/pages/delegateStake.tsx +++ b/wallet-web/pages/delegateStake.tsx @@ -1,14 +1,19 @@ -import React from "react"; -import MainNav from "../components/MainNav"; -import NodeDelegation from "../components/delegate/NodeDelegation"; +import React from 'react' +import MainNav from '../components/MainNav' +import NodeDelegation from '../components/delegate/NodeDelegation' +import { Layout, NymCard } from '../components' const DelegateStake = () => { - return ( - - - - - ); + return ( + <> + + + + + + + + ) } -export default DelegateStake \ No newline at end of file +export default DelegateStake diff --git a/wallet-web/pages/receive.tsx b/wallet-web/pages/receive.tsx new file mode 100644 index 0000000000..2cc134faf3 --- /dev/null +++ b/wallet-web/pages/receive.tsx @@ -0,0 +1,13 @@ +import React from 'react' +import MainNav from '../components/MainNav' + +const Receive = () => { + return ( + <> + +
+ + ) +} + +export default Receive diff --git a/wallet-web/pages/send.tsx b/wallet-web/pages/send.tsx index 5d9dc46df4..611824bbd4 100644 --- a/wallet-web/pages/send.tsx +++ b/wallet-web/pages/send.tsx @@ -1,57 +1,19 @@ import React, { useContext } from 'react' -import { makeStyles } from '@material-ui/core/styles' -import Paper from '@material-ui/core/Paper' +import { printableBalanceToNative } from '@nymproject/nym-validator-client/dist/currency' +import { coin, Coin, printableCoin } from '@nymproject/nym-validator-client' import Stepper from '@material-ui/core/Stepper' import Step from '@material-ui/core/Step' import StepLabel from '@material-ui/core/StepLabel' import Button from '@material-ui/core/Button' import Typography from '@material-ui/core/Typography' +import { Layout, NymCard } from '../components' import { Review } from '../components/send-funds/Review' import SendNymForm from '../components/send-funds/SendNymForm' -import { coin, Coin, printableCoin } from '@nymproject/nym-validator-client' import Confirmation from '../components/Confirmation' import MainNav from '../components/MainNav' import { ValidatorClientContext } from '../contexts/ValidatorClient' import NoClientError from '../components/NoClientError' import { UDENOM } from './_app' -import { printableBalanceToNative } from '@nymproject/nym-validator-client/dist/currency' - -const useStyles = makeStyles((theme) => ({ - appBar: { - position: 'relative', - }, - layout: { - width: 'auto', - marginLeft: theme.spacing(2), - marginRight: theme.spacing(2), - [theme.breakpoints.up(600 + theme.spacing(2) * 2)]: { - width: 600, - marginLeft: 'auto', - marginRight: 'auto', - }, - }, - paper: { - marginTop: theme.spacing(3), - marginBottom: theme.spacing(3), - padding: theme.spacing(2), - [theme.breakpoints.up(600 + theme.spacing(3) * 2)]: { - marginTop: theme.spacing(6), - marginBottom: theme.spacing(6), - padding: theme.spacing(3), - }, - }, - stepper: { - padding: theme.spacing(3, 0, 5), - }, - buttons: { - display: 'flex', - justifyContent: 'flex-end', - }, - button: { - marginTop: theme.spacing(3), - marginLeft: theme.spacing(1), - }, -})) const steps = ['Enter addresses', 'Review & send', 'Await confirmation'] @@ -80,9 +42,9 @@ export default function SendFunds() { return ( ) @@ -90,8 +52,6 @@ export default function SendFunds() { throw new Error('Unknown step') } } - - const classes = useStyles() const { client } = useContext(ValidatorClientContext) console.log('client in send', client) @@ -190,7 +150,7 @@ export default function SendFunds() { const getStepperContent = () => { return ( <> - + {steps.map((label) => ( {label} @@ -200,16 +160,16 @@ export default function SendFunds() { <> {activeStep === steps.length ? ( <> - + Payment complete. - + You ({transaction.sender}) - + have sent {printableCoin(transaction.coin)} - + to {transaction.recipient}. @@ -217,18 +177,15 @@ export default function SendFunds() { <>
{getStepContent(activeStep)} -
+
{activeStep !== 0 && ( - + )} - + + + + + +
+ +
+
+
)} diff --git a/wallet-web/pages/send.tsx b/wallet-web/pages/send.tsx index 611824bbd4..3290822cb4 100644 --- a/wallet-web/pages/send.tsx +++ b/wallet-web/pages/send.tsx @@ -1,11 +1,15 @@ import React, { useContext } from 'react' import { printableBalanceToNative } from '@nymproject/nym-validator-client/dist/currency' import { coin, Coin, printableCoin } from '@nymproject/nym-validator-client' -import Stepper from '@material-ui/core/Stepper' -import Step from '@material-ui/core/Step' -import StepLabel from '@material-ui/core/StepLabel' -import Button from '@material-ui/core/Button' -import Typography from '@material-ui/core/Typography' +import { + Paper, + Stepper, + Step, + StepLabel, + Button, + Typography, +} from '@material-ui/core' +import { theme } from '../lib/theme' import { Layout, NymCard } from '../components' import { Review } from '../components/send-funds/Review' import SendNymForm from '../components/send-funds/SendNymForm' @@ -149,8 +153,8 @@ export default function SendFunds() { const getStepperContent = () => { return ( - <> - + + {steps.map((label) => ( {label} @@ -177,7 +181,13 @@ export default function SendFunds() { <> {getStepContent(activeStep)} -
+
{activeStep !== 0 && ( )} @@ -198,7 +208,7 @@ export default function SendFunds() { )} - + ) } From b034a07439553738657f463fc7b24ed9ed8ac73c Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 27 Jul 2021 17:50:42 +0100 Subject: [PATCH 06/11] display alert when no client detected --- wallet-web/components/Layout.tsx | 2 +- wallet-web/pages/receive.tsx | 43 +++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/wallet-web/components/Layout.tsx b/wallet-web/components/Layout.tsx index 4200d6ab88..09befee3bc 100644 --- a/wallet-web/components/Layout.tsx +++ b/wallet-web/components/Layout.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Grid, Theme, useTheme, useMediaQuery } from '@material-ui/core' +import { Grid, Theme, useTheme } from '@material-ui/core' export const Layout = ({ children }: { children: React.ReactElement }) => { const theme: Theme = useTheme() diff --git a/wallet-web/pages/receive.tsx b/wallet-web/pages/receive.tsx index 2cc134faf3..da250046ae 100644 --- a/wallet-web/pages/receive.tsx +++ b/wallet-web/pages/receive.tsx @@ -1,11 +1,52 @@ +import { useMediaQuery } from '@material-ui/core' +import { + Card, + CardContent, + CardHeader, + Grid, + Typography, +} from '@material-ui/core' import React from 'react' +import { useContext } from 'react' +import { Layout, NymCard } from '../components' import MainNav from '../components/MainNav' +import NoClientError from '../components/NoClientError' +import { ValidatorClientContext } from '../contexts/ValidatorClient' const Receive = () => { + const { client } = useContext(ValidatorClientContext) + const matches = useMediaQuery('(min-width:769px)') + return ( <> -
+ + + {!client ? ( + + ) : ( + + + + You can receive tokens by providing this address to the sender + + + + + + + {client?.address} + + + + + + )} + + ) } From 75f098f002f88e939f11c2df78bcb1e8f5f5e6ac Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 27 Jul 2021 20:07:23 +0100 Subject: [PATCH 07/11] style update --- wallet-web/components/NymCard.tsx | 2 +- wallet-web/pages/bond.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wallet-web/components/NymCard.tsx b/wallet-web/components/NymCard.tsx index 6c2f93c19b..0c0112afa7 100644 --- a/wallet-web/components/NymCard.tsx +++ b/wallet-web/components/NymCard.tsx @@ -12,7 +12,7 @@ export const NymCard = ({ }) => { const theme = useTheme() return ( - + { <> - + From e8622a190a0f975330409621203f963d06a15e80 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Wed, 28 Jul 2021 10:53:37 +0100 Subject: [PATCH 08/11] layout and icon updates --- wallet-web/components/MainNav.tsx | 34 ++++++++++++------- wallet-web/components/bond/NodeBond.tsx | 8 +++-- .../components/delegate/NodeDelegation.tsx | 10 ++++-- .../delegation-check/DelegationCheck.tsx | 10 ++++-- wallet-web/components/unbond/UnbondNode.tsx | 8 +++-- .../undelegate/NodeUndelegation.tsx | 10 ++++-- 6 files changed, 53 insertions(+), 27 deletions(-) diff --git a/wallet-web/components/MainNav.tsx b/wallet-web/components/MainNav.tsx index 5e4fb5c031..9f5ea4cebb 100644 --- a/wallet-web/components/MainNav.tsx +++ b/wallet-web/components/MainNav.tsx @@ -18,12 +18,20 @@ import AccountBalanceWalletIcon from '@material-ui/icons/AccountBalanceWallet' import { ValidatorClientContext } from '../contexts/ValidatorClient' import { ADMIN_ADDRESS } from '../pages/_app' import MenuIcon from '@material-ui/icons/Menu' -import MonetizationOnIcon from '@material-ui/icons/MonetizationOn' -import AttachMoneyIcon from '@material-ui/icons/AttachMoney' -import MoneyOffIcon from '@material-ui/icons/MoneyOff' -import HowToVoteIcon from '@material-ui/icons/HowToVote' -import CancelIcon from '@material-ui/icons/Cancel' -import PageviewIcon from '@material-ui/icons/Pageview' +import { + MonetizationOn, + AttachMoney, + MoneyOff, + HowToVote, + Cancel, + Pageview, + ArrowRightAlt, + ArrowLeft, + ArrowRightSharp, + ArrowForward, + ArrowBack, +} from '@material-ui/icons' + import { makeBasicStyle } from '../common/helpers' import { theme } from '../lib/theme' @@ -88,7 +96,7 @@ export default function MainNav() { - + @@ -97,7 +105,7 @@ export default function MainNav() { - + @@ -112,7 +120,7 @@ export default function MainNav() { - + @@ -121,7 +129,7 @@ export default function MainNav() { - + @@ -130,7 +138,7 @@ export default function MainNav() { - + @@ -139,7 +147,7 @@ export default function MainNav() { - + @@ -148,7 +156,7 @@ export default function MainNav() { - + diff --git a/wallet-web/components/bond/NodeBond.tsx b/wallet-web/components/bond/NodeBond.tsx index f2c5727c2b..fc07e6f1a1 100644 --- a/wallet-web/components/bond/NodeBond.tsx +++ b/wallet-web/components/bond/NodeBond.tsx @@ -136,7 +136,7 @@ const BondNode = () => { // we haven't clicked bond button yet if (!isLoading) { return ( - + <> { minimumGatewayBond={minimumGatewayBond} minimumMixnodeBond={minimumMixnodeBond} /> - + ) } @@ -165,7 +165,9 @@ const BondNode = () => { - {getBondContent()} + + {getBondContent()} + ) } diff --git a/wallet-web/components/delegate/NodeDelegation.tsx b/wallet-web/components/delegate/NodeDelegation.tsx index fcad76ccad..830b18af92 100644 --- a/wallet-web/components/delegate/NodeDelegation.tsx +++ b/wallet-web/components/delegate/NodeDelegation.tsx @@ -80,10 +80,10 @@ const DelegateToNode = () => { // we haven't clicked delegate button yet if (!isLoading) { return ( - + <> - + ) } @@ -104,7 +104,11 @@ const DelegateToNode = () => { - {getDelegationContent()} + + + {getDelegationContent()} + + ) } diff --git a/wallet-web/components/delegation-check/DelegationCheck.tsx b/wallet-web/components/delegation-check/DelegationCheck.tsx index e428397f36..f5a29b57e5 100644 --- a/wallet-web/components/delegation-check/DelegationCheck.tsx +++ b/wallet-web/components/delegation-check/DelegationCheck.tsx @@ -83,13 +83,13 @@ const DelegationCheck = () => { // we haven't clicked delegate button yet if (!isLoading && !stakeValue) { return ( - + <> - + ) } @@ -106,7 +106,11 @@ const DelegationCheck = () => { ) } - return <>{getDelegationCheckContent()} + return ( + + {getDelegationCheckContent()} + + ) } export default DelegationCheck diff --git a/wallet-web/components/unbond/UnbondNode.tsx b/wallet-web/components/unbond/UnbondNode.tsx index 87e8ae93cd..0afe08706d 100644 --- a/wallet-web/components/unbond/UnbondNode.tsx +++ b/wallet-web/components/unbond/UnbondNode.tsx @@ -1,5 +1,5 @@ import React, { useContext, useEffect } from 'react' -import { Grid, LinearProgress, Typography } from '@material-ui/core' +import { Grid, LinearProgress, Paper, Typography } from '@material-ui/core' import { Alert } from '@material-ui/lab' import { useRouter } from 'next/router' import { NodeType } from '../../common/node' @@ -130,7 +130,11 @@ const UnbondNode = () => { - {getUnbondContent()} + + + {getUnbondContent()} + + ) } diff --git a/wallet-web/components/undelegate/NodeUndelegation.tsx b/wallet-web/components/undelegate/NodeUndelegation.tsx index b7e5a1b884..08d92bd706 100644 --- a/wallet-web/components/undelegate/NodeUndelegation.tsx +++ b/wallet-web/components/undelegate/NodeUndelegation.tsx @@ -66,13 +66,13 @@ const UndelegateFromNode = () => { // we haven't clicked undelegate button yet if (!isLoading) { return ( - + <> - + ) } @@ -93,7 +93,11 @@ const UndelegateFromNode = () => { - {getUndelegationContent()} + + + {getUndelegationContent()} + + ) } From de468760d6785c3df5d8a8be092b6e8d7eb01116 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Wed, 28 Jul 2021 14:17:13 +0100 Subject: [PATCH 09/11] update layout --- wallet-web/components/Layout.tsx | 2 +- wallet-web/components/bond/BondNodeForm.tsx | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/wallet-web/components/Layout.tsx b/wallet-web/components/Layout.tsx index 09befee3bc..e73e2b9ce3 100644 --- a/wallet-web/components/Layout.tsx +++ b/wallet-web/components/Layout.tsx @@ -11,7 +11,7 @@ export const Layout = ({ children }: { children: React.ReactElement }) => { }} > - + {children} diff --git a/wallet-web/components/bond/BondNodeForm.tsx b/wallet-web/components/bond/BondNodeForm.tsx index 5d3735e59c..c3a358a0e3 100644 --- a/wallet-web/components/bond/BondNodeForm.tsx +++ b/wallet-web/components/bond/BondNodeForm.tsx @@ -9,6 +9,7 @@ import { InputAdornment, Grid, TextField, + useMediaQuery, } from '@material-ui/core' import bs58 from 'bs58' import semver from 'semver' @@ -81,6 +82,8 @@ export default function BondNodeForm(props: TBondNodeFormProps) { getBalance() }, [getBalance]) + const matches = useMediaQuery('(min-width:768px)') + const handleCheckboxToggle = () => { setAdvancedShown((prevSet) => !prevSet) } @@ -312,9 +315,11 @@ export default function BondNodeForm(props: TBondNodeFormProps) { required id="amount" name="amount" - label={`Amount to bond (minimum ${nativeToPrintable( - minimumBond.amount - )} ${minimumBond.denom})`} + label={`Amount to bond ${ + matches + ? '(minimum ' + nativeToPrintable(minimumBond.amount) + ')' + : '' + }`} error={!validateAmount} helperText={ !validateAmount From 87db1fd8c148a86e4326d9dd0add9c557a455b15 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Wed, 28 Jul 2021 17:45:45 +0100 Subject: [PATCH 10/11] update breakpoint for large screens --- wallet-web/components/Layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet-web/components/Layout.tsx b/wallet-web/components/Layout.tsx index e73e2b9ce3..26aea37b7d 100644 --- a/wallet-web/components/Layout.tsx +++ b/wallet-web/components/Layout.tsx @@ -11,7 +11,7 @@ export const Layout = ({ children }: { children: React.ReactElement }) => { }} > - + {children} From c569a7a858eefea85eea577711dfe9cbba391a4b Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Wed, 28 Jul 2021 18:01:40 +0100 Subject: [PATCH 11/11] ui tweak --- .../components/delegate/DelegateForm.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/wallet-web/components/delegate/DelegateForm.tsx b/wallet-web/components/delegate/DelegateForm.tsx index 67aac7da76..cb8caecb8e 100644 --- a/wallet-web/components/delegate/DelegateForm.tsx +++ b/wallet-web/components/delegate/DelegateForm.tsx @@ -83,13 +83,13 @@ export default function DelegateForm(props: DelegateFormProps) { return ( - + - + {DENOM} + {DENOM} ), }} /> {allocationWarning && ( - + {allocationWarning} @@ -140,9 +140,9 @@ export default function DelegateForm(props: DelegateFormProps) {