using Consoles and some refactor

This commit is contained in:
Gala
2022-10-10 11:48:22 +02:00
parent f72a38a5a8
commit 99cfdab601
3 changed files with 15 additions and 10 deletions
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { yupResolver } from '@hookform/resolvers/yup';
import { Button, Divider, Typography, TextField, Grid, Alert, IconButton, CircularProgress } from '@mui/material';
import { Button, Divider, Typography, TextField, Grid, Alert, IconButton, CircularProgress, Box } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import CloseIcon from '@mui/icons-material/Close';
import { isMixnode } from 'src/types';
@@ -9,6 +9,7 @@ import { updateMixnodeConfig } from 'src/requests';
import { TBondedMixnode, TBondedGateway } from 'src/context/bonding';
import { SimpleModal } from 'src/components/Modals/SimpleModal';
import { bondedInfoParametersValidationSchema } from 'src/components/Bonding/forms/mixnodeValidationSchema';
import { Console } from 'src/utils/console';
export const InfoSettings = ({ bondedNode }: { bondedNode: TBondedMixnode | TBondedGateway }) => {
const [open, setOpen] = useState(true);
@@ -46,7 +47,7 @@ export const InfoSettings = ({ bondedNode }: { bondedNode: TBondedMixnode | TBon
await updateMixnodeConfig(MixNodeConfigParams);
setOpenConfirmationModal(true);
} catch (error) {
console.error(error);
Console.error(error);
}
}
};
@@ -76,8 +77,8 @@ export const InfoSettings = ({ bondedNode }: { bondedNode: TBondedMixnode | TBon
'& .MuiAlert-icon': { color: (theme) => theme.palette.nym.nymWallet.text.blue, mr: 1 },
}}
>
<strong>Your changes will be ONLY saved on the display.</strong> Remember to change the values on your nodes
config file too.
<Box sx={{ fontWeight: 600 }}>Your changes will be ONLY saved on the display.</Box> Remember to change the
values on your nodes config file too.
</Alert>
)}
<Grid container>
@@ -11,6 +11,7 @@ import {
Alert,
IconButton,
CircularProgress,
Box,
} from '@mui/material';
import { useTheme } from '@mui/material/styles';
import CloseIcon from '@mui/icons-material/Close';
@@ -19,6 +20,7 @@ import { updateMixnodeCostParams } from 'src/requests';
import { TBondedMixnode, TBondedGateway } from 'src/context/bonding';
import { SimpleModal } from 'src/components/Modals/SimpleModal';
import { bondedNodeParametersValidationSchema } from 'src/components/Bonding/forms/mixnodeValidationSchema';
import { Console } from 'src/utils/console';
export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode | TBondedGateway }): JSX.Element => {
const [open, setOpen] = useState(true);
@@ -54,7 +56,7 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
await updateMixnodeCostParams(MixNodeCostParams);
setOpenConfirmationModal(true);
} catch (error) {
console.error(error);
Console.error(error);
}
}
};
@@ -85,7 +87,9 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
'& .MuiAlert-icon': { color: (theme) => theme.palette.nym.nymWallet.text.blue, mr: 1 },
}}
>
<strong>Profit margin can be changed once a month, your changes will be applied in the next interval</strong>
<Box sx={{ fontWeight: 600 }}>
Profit margin can be changed once a month, your changes will be applied in the next interval
</Box>
</Alert>
)}
<Grid container direction="column">
@@ -118,7 +122,7 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
InputProps={{
endAdornment: (
<InputAdornment position="end">
<span>%</span>
<Box>%</Box>
</InputAdornment>
),
}}
@@ -156,7 +160,7 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
InputProps={{
endAdornment: (
<InputAdornment position="end">
<span>{bondedNode.bond.denom.toUpperCase()}</span>
<Box>{bondedNode.bond.denom.toUpperCase()}</Box>
</InputAdornment>
),
}}
+2 -2
View File
@@ -110,11 +110,11 @@ const TerminalInner: React.FC = () => {
{status ? (
<Alert color="info" icon={<RefreshIcon />} sx={{ mb: 2 }}>
<strong>{status}</strong>
<Box sx={{ fontWeight: 600 }}>{status}</Box>
</Alert>
) : (
<Alert color="success" sx={{ mb: 2 }}>
<strong>Data loading complete</strong>
<Box sx={{ fontWeight: 600 }}>Data loading complete</Box>
</Alert>
)}