removing epoch on settings and fixing divider position

This commit is contained in:
Gala
2022-12-15 15:22:44 +01:00
committed by Jon Häggblad
parent 2d71caf50a
commit a8ccd2ec17
2 changed files with 13 additions and 9 deletions
@@ -38,7 +38,6 @@ import { LoadingModal } from 'src/components/Modals/LoadingModal';
export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode }): JSX.Element => {
const [openConfirmationModal, setOpenConfirmationModal] = useState<boolean>(false);
const [intervalTime, setIntervalTime] = useState<string>();
const [nextEpoch, setNextEpoch] = useState<string>();
const [pendingUpdates, setPendingUpdates] = useState<MixNodeCostParams>();
const { clientDetails } = useContext(AppContext);
const theme = useTheme();
@@ -65,7 +64,6 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
const getNextInterval = async () => {
try {
const { intervalTime, nextEpoch } = await getIntervalAsDate();
setNextEpoch(nextEpoch);
setIntervalTime(intervalTime);
} catch {
console.log('cant retrieve next interval');
@@ -123,7 +121,16 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
};
return (
<Grid container xs item>
<Grid
container
xs
item
sx={{
'& .MuiGrid-item': {
pl: 0,
},
}}
>
{fee && (
<ConfirmTx
open
@@ -138,9 +145,6 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
<Alert
title={
<>
<Box component="span" sx={{ fontWeight: 600, mr: 2 }}>
{`Next epoch ${nextEpoch}`}
</Box>
<Box component="span" sx={{ fontWeight: 600 }}>{`Next interval: ${intervalTime}`}</Box>
</>
}
@@ -192,7 +196,7 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
</Grid>
)}
</Grid>
<Divider flexItem />
<Divider flexItem sx={{ position: 'relative', left: '-24px', width: 'calc(100% + 24px)' }} />
<Grid item container direction="row" alignItems="left" justifyContent="space-between" padding={3} spacing={1}>
<Grid item>
<Typography variant="body1" sx={{ fontWeight: 600, mb: 1 }}>
@@ -235,7 +239,7 @@ export const ParametersSettings = ({ bondedNode }: { bondedNode: TBondedMixnode
</Grid>
</Grid>
</Grid>
<Divider flexItem />
<Divider flexItem sx={{ position: 'relative', left: '-24px', width: 'calc(100% + 24px)' }} />
<Grid container justifyContent="end">
<Button
size="large"
+1 -1
View File
@@ -10,7 +10,7 @@ export const getIntervalAsDate = async () => {
add(new Date(), {
seconds: secondsToNextInterval,
}),
'MM/dd/yyyy HH:mm',
'MM/dd/yyyy, HH:mm',
);
const nextEpoch = format(
add(fromUnixTime(Number(interval.current_epoch_start_unix)), {