fix conflicts

This commit is contained in:
Gala
2022-09-21 17:03:56 +02:00
parent ebb06d4beb
commit 978cbc4f00
3 changed files with 1 additions and 82 deletions
@@ -20,15 +20,9 @@ export const NodeSettings = ({
onClose,
onError,
}: {
<<<<<<< HEAD
currentPm?: TBondedMixnode['profitMargin'];
isVesting?: boolean;
onConfirm: (profitMargin: number, fee?: FeeDetails) => Promise<void>;
=======
currentPm: TBondedMixnode['profitMargin'];
isVesting: boolean;
onConfirm: (profitMargin: string, fee?: FeeDetails) => Promise<void>;
>>>>>>> develop
onClose: () => void;
onError: (err: string) => void;
}) => {
@@ -81,7 +75,7 @@ export const NodeSettings = ({
if (isFeeLoading) return <LoadingModal />;
if (fee)
if (fee && pm)
return (
<ConfirmTx
open
@@ -1,12 +1,6 @@
<<<<<<< HEAD
import { useState, useEffect } from 'react';
import { Typography, Alert, TextField } from '@mui/material';
import { useTheme } from '@mui/material/styles';
=======
import * as React from 'react';
import { Box, TextField, Typography } from '@mui/material';
import { useEffect, useState } from 'react';
>>>>>>> develop
import { TBondedGateway, TBondedMixnode } from 'src/context';
import { useGetFee } from 'src/hooks/useGetFee';
import { isGateway, isMixnode } from 'src/types';
@@ -29,62 +23,12 @@ interface Props {
onError: (e: string) => void;
}
<<<<<<< HEAD
type TUnbondModalStep = 1 | 2 | 3;
const UnbondFirstStep = ({ handleVerification, onClose }: { handleVerification: any; onClose: () => void }) => {
const [verificationText, setVerificationText] = useState<string>('');
=======
export const UnbondModal = ({ node, onConfirm, onClose, onError }: Props) => {
const { fee, isFeeLoading, getFee, feeError } = useGetFee();
const [isConfirmed, setIsConfirmed] = useState(false);
const [showConfirmModal, setShowConfirmModal] = useState(true);
const [confirmField, setConfirmField] = useState('');
>>>>>>> develop
const theme = useTheme();
return (
<SimpleModal
open
header="Unbond"
okLabel="Unbond"
okDisabled={!verificationText.toUpperCase().match(/^UNBOND$/)}
onOk={handleVerification}
onClose={onClose}
>
<Typography sx={{ fontSize: 14, fontWeight: 600, mb: 3 }}>
If you unbond your node you will loose all your delegators!
</Typography>
<Alert
severity="error"
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
textAlign: 'center',
}}
>
This action is irreversible and it will not be possible to restore the current state again
</Alert>
<Typography sx={{ my: 3, fontSize: 14 }}>
To unbond, type <span style={{ color: theme.palette.nym.highlight }}>UNBOND</span> in the field below and click
UNBOND button
</Typography>
<TextField
type="input"
value={verificationText}
onChange={(e) => {
setVerificationText(e.target.value);
}}
fullWidth
/>
</SimpleModal>
);
};
const UnbondSecondStep = ({ node, onConfirm, onClose, onError }: Props) => {
const { fee, isFeeLoading, getFee, feeError } = useGetFee();
useEffect(() => {
if (feeError) {
onError(feeError);
@@ -169,18 +113,3 @@ const UnbondSecondStep = ({ node, onConfirm, onClose, onError }: Props) => {
}
return <Box />;
};
export const UnbondModal = ({ node, onConfirm, onClose, onError }: Props) => {
const [step, setStep] = useState<TUnbondModalStep>(1);
const handleVerification = () => {
setStep(2);
};
return (
<div>
{step === 1 && <UnbondFirstStep handleVerification={handleVerification} onClose={onClose} />}
{step === 2 && <UnbondSecondStep onClose={onClose} onConfirm={onConfirm} onError={onError} node={node} />}
</div>
);
};
@@ -70,11 +70,7 @@ export const SimpleModal: React.FC<{
{children}
{(onOk || onBack) && (
<<<<<<< HEAD
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mt: 2, width: buttonFullWidth ? '100%' : null }}>
=======
<Box sx={{ display: 'flex', alignItems: 'center', gap: 3, mt: 3 }}>
>>>>>>> develop
{onBack && <StyledBackButton onBack={onBack} />}
{onOk && (
<Button variant="contained" fullWidth size="large" onClick={onOk} disabled={okDisabled}>