From 78f0633669ccc3b8afdb07ee58d30e994ea80eab Mon Sep 17 00:00:00 2001 From: Gala Date: Mon, 9 Oct 2023 16:32:41 +0200 Subject: [PATCH] info txt --- .../docs/components/wallet/delegations.tsx | 40 +++++++++----- .../wallet/utils/wallet.context.tsx | 52 +++++++++++-------- 2 files changed, 56 insertions(+), 36 deletions(-) diff --git a/sdk/typescript/docs/components/wallet/delegations.tsx b/sdk/typescript/docs/components/wallet/delegations.tsx index 94bace445d..f8a954e4a0 100644 --- a/sdk/typescript/docs/components/wallet/delegations.tsx +++ b/sdk/typescript/docs/components/wallet/delegations.tsx @@ -1,28 +1,30 @@ -import React, { use, useEffect, useState } from 'react'; +import { useState } from 'react'; import Button from '@mui/material/Button'; import Paper from '@mui/material/Paper'; import Box from '@mui/material/Box'; -import { TableBody, TableCell, TableHead, TableRow, TextField, Typography } from '@mui/material'; +import Typography from '@mui/material/Typography'; +import TextField from '@mui/material/TextField'; +import Alert from '@mui/material/Alert'; import Table from '@mui/material/Table'; -import { useWalletContext, WalletContextProvider } from './utils/wallet.context'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableHead from '@mui/material/TableHead'; +import TableRow from '@mui/material/TableRow'; +import { useWalletContext } from './utils/wallet.context'; export const Delegations = () => { const { delegations, doDelegate, delegationLoader, unDelegateAll, unDelegateAllLoading, log } = useWalletContext(); const [delegationNodeId, setDelegationNodeId] = useState(); const [amountToBeDelegated, setAmountToBeDelegated] = useState(); + const [infoText, setInfoText] = useState(''); const cleanFields = () => { setDelegationNodeId(''); setAmountToBeDelegated(''); + setInfoText(''); }; - useEffect(() => { - return () => { - cleanFields(); - }; - }, []); - return ( @@ -49,7 +51,8 @@ export const Delegations = () => {