mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
Format code, rmove unused
This commit is contained in:
@@ -13,29 +13,29 @@ import {
|
||||
InputLabel,
|
||||
Snackbar,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
} from '@mui/material';
|
||||
import React, {
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import { MyContext, getBaseApiReact } from "../../App";
|
||||
} from 'react';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import { MyContext, getBaseApiReact } from '../../App';
|
||||
import {
|
||||
executeEvent,
|
||||
subscribeToEvent,
|
||||
unsubscribeFromEvent,
|
||||
} from "../../utils/events";
|
||||
import { getFee, getNameOrAddress } from "../../background";
|
||||
import CopyToClipboard from "react-copy-to-clipboard";
|
||||
import { AddressBox } from "../../App-styles";
|
||||
import { Spacer } from "../../common/Spacer";
|
||||
import Copy from "../../assets/svgs/Copy.svg";
|
||||
import { Loader } from "../Loader";
|
||||
import { FidgetSpinner } from "react-loader-spinner";
|
||||
import { useModal } from "../../common/useModal";
|
||||
} from '../../utils/events';
|
||||
import { getFee, getNameOrAddress } from '../../background';
|
||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||
import { AddressBox } from '../../styles/App-styles';
|
||||
import { Spacer } from '../../common/Spacer';
|
||||
import Copy from '../../assets/svgs/Copy.svg';
|
||||
import { Loader } from '../Loader';
|
||||
import { FidgetSpinner } from 'react-loader-spinner';
|
||||
import { useModal } from '../../common/useModal';
|
||||
|
||||
export const Minting = ({
|
||||
setIsOpenMinting,
|
||||
@@ -47,30 +47,30 @@ export const Minting = ({
|
||||
}) => {
|
||||
const [mintingAccounts, setMintingAccounts] = useState([]);
|
||||
const [accountInfo, setAccountInfo] = useState(null);
|
||||
const [rewardSharePublicKey, setRewardSharePublicKey] = useState("");
|
||||
const [mintingKey, setMintingKey] = useState("");
|
||||
const [rewardsharekey, setRewardsharekey] = useState("");
|
||||
const [rewardSharePublicKey, setRewardSharePublicKey] = useState('');
|
||||
const [mintingKey, setMintingKey] = useState('');
|
||||
const [rewardsharekey, setRewardsharekey] = useState('');
|
||||
const [rewardShares, setRewardShares] = useState([]);
|
||||
const [nodeInfos, setNodeInfos] = useState({});
|
||||
const [openSnack, setOpenSnack] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const { show: showKey, message } = useModal();
|
||||
const { isShow: isShowNext, onOk, show: showNext } = useModal();
|
||||
const { show: showKey, message } = useModal();
|
||||
const { isShow: isShowNext, onOk, show: showNext } = useModal();
|
||||
|
||||
const [info, setInfo] = useState(null);
|
||||
const [names, setNames] = useState({});
|
||||
const [accountInfos, setAccountInfos] = useState({});
|
||||
const [showWaitDialog, setShowWaitDialog] = useState(false)
|
||||
const [showWaitDialog, setShowWaitDialog] = useState(false);
|
||||
const isPartOfMintingGroup = useMemo(() => {
|
||||
if (groups?.length === 0) return false;
|
||||
return !!groups?.find((item) => item?.groupId?.toString() === "694");
|
||||
return !!groups?.find((item) => item?.groupId?.toString() === '694');
|
||||
}, [groups]);
|
||||
const getMintingAccounts = useCallback(async () => {
|
||||
try {
|
||||
const url = `${getBaseApiReact()}/admin/mintingaccounts`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error("network error");
|
||||
throw new Error('network error');
|
||||
}
|
||||
const data = await response.json();
|
||||
setMintingAccounts(data);
|
||||
@@ -117,7 +117,7 @@ export const Minting = ({
|
||||
const url = `${getBaseApiReact()}/addresses/${address}`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error("network error");
|
||||
throw new Error('network error');
|
||||
}
|
||||
const data = await response.json();
|
||||
if (others) {
|
||||
@@ -144,10 +144,10 @@ export const Minting = ({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
subscribeToEvent("refresh-rewardshare-list", refreshRewardShare);
|
||||
subscribeToEvent('refresh-rewardshare-list', refreshRewardShare);
|
||||
|
||||
return () => {
|
||||
unsubscribeFromEvent("refresh-rewardshare-list", refreshRewardShare);
|
||||
unsubscribeFromEvent('refresh-rewardshare-list', refreshRewardShare);
|
||||
};
|
||||
}, [myAddress]);
|
||||
|
||||
@@ -177,15 +177,15 @@ export const Minting = ({
|
||||
try {
|
||||
const url = `${getBaseApiReact()}/admin/status`;
|
||||
const response = await fetch(url, {
|
||||
method: "GET",
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
const data = await response.json();
|
||||
setNodeInfos(data);
|
||||
} catch (error) {
|
||||
console.error("Request failed", error);
|
||||
console.error('Request failed', error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -194,11 +194,11 @@ export const Minting = ({
|
||||
const url = `${getBaseApiReact()}/addresses/rewardshares?involving=${address}`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error("network error");
|
||||
throw new Error('network error');
|
||||
}
|
||||
const data = await response.json();
|
||||
setRewardShares(data);
|
||||
return data
|
||||
return data;
|
||||
} catch (error) {}
|
||||
}, []);
|
||||
|
||||
@@ -208,10 +208,10 @@ export const Minting = ({
|
||||
return await new Promise((res, rej) => {
|
||||
window
|
||||
.sendMessage(
|
||||
"ADMIN_ACTION",
|
||||
'ADMIN_ACTION',
|
||||
|
||||
{
|
||||
type: "addmintingaccount",
|
||||
type: 'addmintingaccount',
|
||||
value: val,
|
||||
},
|
||||
180000,
|
||||
@@ -220,7 +220,7 @@ export const Minting = ({
|
||||
.then((response) => {
|
||||
if (!response?.error) {
|
||||
res(response);
|
||||
setMintingKey("");
|
||||
setMintingKey('');
|
||||
setTimeout(() => {
|
||||
getMintingAccounts();
|
||||
}, 300);
|
||||
@@ -229,13 +229,13 @@ export const Minting = ({
|
||||
rej({ message: response.error });
|
||||
})
|
||||
.catch((error) => {
|
||||
rej({ message: error.message || "An error occurred" });
|
||||
rej({ message: error.message || 'An error occurred' });
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
setInfo({
|
||||
type: "error",
|
||||
message: error?.message || "Unable to add minting account",
|
||||
type: 'error',
|
||||
message: error?.message || 'Unable to add minting account',
|
||||
});
|
||||
setOpenSnack(true);
|
||||
} finally {
|
||||
@@ -249,10 +249,10 @@ export const Minting = ({
|
||||
return await new Promise((res, rej) => {
|
||||
window
|
||||
.sendMessage(
|
||||
"ADMIN_ACTION",
|
||||
'ADMIN_ACTION',
|
||||
|
||||
{
|
||||
type: "removemintingaccount",
|
||||
type: 'removemintingaccount',
|
||||
value: val,
|
||||
},
|
||||
180000,
|
||||
@@ -270,13 +270,13 @@ export const Minting = ({
|
||||
rej({ message: response.error });
|
||||
})
|
||||
.catch((error) => {
|
||||
rej({ message: error.message || "An error occurred" });
|
||||
rej({ message: error.message || 'An error occurred' });
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
setInfo({
|
||||
type: "error",
|
||||
message: error?.message || "Unable to remove minting account",
|
||||
type: 'error',
|
||||
message: error?.message || 'Unable to remove minting account',
|
||||
});
|
||||
setOpenSnack(true);
|
||||
} finally {
|
||||
@@ -285,14 +285,14 @@ export const Minting = ({
|
||||
}, []);
|
||||
|
||||
const createRewardShare = useCallback(async (publicKey, recipient) => {
|
||||
const fee = await getFee("REWARD_SHARE");
|
||||
const fee = await getFee('REWARD_SHARE');
|
||||
await show({
|
||||
message: "Would you like to perform an REWARD_SHARE transaction?",
|
||||
publishFee: fee.fee + " QORT",
|
||||
message: 'Would you like to perform an REWARD_SHARE transaction?',
|
||||
publishFee: fee.fee + ' QORT',
|
||||
});
|
||||
return await new Promise((res, rej) => {
|
||||
window
|
||||
.sendMessage("createRewardShare", {
|
||||
.sendMessage('createRewardShare', {
|
||||
recipientPublicKey: publicKey,
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -301,7 +301,7 @@ export const Minting = ({
|
||||
{
|
||||
recipient,
|
||||
...response,
|
||||
type: "add-rewardShare",
|
||||
type: 'add-rewardShare',
|
||||
label: `Add rewardshare: awaiting confirmation`,
|
||||
labelDone: `Add rewardshare: success!`,
|
||||
done: false,
|
||||
@@ -314,7 +314,7 @@ export const Minting = ({
|
||||
rej({ message: response.error });
|
||||
})
|
||||
.catch((error) => {
|
||||
rej({ message: error.message || "An error occurred" });
|
||||
rej({ message: error.message || 'An error occurred' });
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
@@ -322,7 +322,7 @@ export const Minting = ({
|
||||
const getRewardSharePrivateKey = useCallback(async (publicKey) => {
|
||||
return await new Promise((res, rej) => {
|
||||
window
|
||||
.sendMessage("getRewardSharePrivateKey", {
|
||||
.sendMessage('getRewardSharePrivateKey', {
|
||||
recipientPublicKey: publicKey,
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -333,7 +333,7 @@ export const Minting = ({
|
||||
rej({ message: response.error });
|
||||
})
|
||||
.catch((error) => {
|
||||
rej({ message: error.message || "An error occurred" });
|
||||
rej({ message: error.message || 'An error occurred' });
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
@@ -341,26 +341,24 @@ export const Minting = ({
|
||||
const waitUntilRewardShareIsConfirmed = async (timeoutMs = 600000) => {
|
||||
const pollingInterval = 30000;
|
||||
const startTime = Date.now();
|
||||
|
||||
|
||||
const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||
|
||||
|
||||
while (Date.now() - startTime < timeoutMs) {
|
||||
|
||||
const rewardShares = await getRewardShares(myAddress);
|
||||
const findRewardShare = rewardShares?.find(
|
||||
(item) =>
|
||||
item?.recipient === myAddress && item?.mintingAccount === myAddress
|
||||
);
|
||||
|
||||
if (findRewardShare) {
|
||||
return true; // Exit early if found
|
||||
}
|
||||
|
||||
|
||||
const rewardShares = await getRewardShares(myAddress);
|
||||
const findRewardShare = rewardShares?.find(
|
||||
(item) =>
|
||||
item?.recipient === myAddress && item?.mintingAccount === myAddress
|
||||
);
|
||||
|
||||
if (findRewardShare) {
|
||||
return true; // Exit early if found
|
||||
}
|
||||
|
||||
await sleep(pollingInterval); // Wait before the next poll
|
||||
}
|
||||
|
||||
throw new Error("Timeout waiting for reward share confirmation");
|
||||
|
||||
throw new Error('Timeout waiting for reward share confirmation');
|
||||
};
|
||||
|
||||
const startMinting = async () => {
|
||||
@@ -377,23 +375,22 @@ export const Minting = ({
|
||||
addMintingAccount(privateRewardShare);
|
||||
} else {
|
||||
await createRewardShare(accountInfo?.publicKey, myAddress);
|
||||
setShowWaitDialog(true)
|
||||
await waitUntilRewardShareIsConfirmed()
|
||||
setShowWaitDialog(true);
|
||||
await waitUntilRewardShareIsConfirmed();
|
||||
await showNext({
|
||||
message: ''
|
||||
})
|
||||
message: '',
|
||||
});
|
||||
const privateRewardShare = await getRewardSharePrivateKey(
|
||||
accountInfo?.publicKey
|
||||
);
|
||||
setShowWaitDialog(false)
|
||||
setShowWaitDialog(false);
|
||||
addMintingAccount(privateRewardShare);
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
setShowWaitDialog(false)
|
||||
setShowWaitDialog(false);
|
||||
setInfo({
|
||||
type: "error",
|
||||
message: error?.message || "Unable to start minting",
|
||||
type: 'error',
|
||||
message: error?.message || 'Unable to start minting',
|
||||
});
|
||||
setOpenSnack(true);
|
||||
} finally {
|
||||
@@ -412,13 +409,13 @@ export const Minting = ({
|
||||
const url = `${getBaseApiReact()}/groups/member/${address}`;
|
||||
const response = await fetch(url);
|
||||
const data = await response.json();
|
||||
return !!data?.find((grp) => grp?.groupId?.toString() === "694");
|
||||
return !!data?.find((grp) => grp?.groupId?.toString() === '694');
|
||||
};
|
||||
|
||||
const removeRewardShare = useCallback(async (rewardShare) => {
|
||||
return await new Promise((res, rej) => {
|
||||
window
|
||||
.sendMessage("removeRewardShare", {
|
||||
.sendMessage('removeRewardShare', {
|
||||
rewardShareKeyPairPublicKey: rewardShare.rewardSharePublicKey,
|
||||
recipient: rewardShare.recipient,
|
||||
percentageShare: -1,
|
||||
@@ -430,7 +427,7 @@ export const Minting = ({
|
||||
{
|
||||
...rewardShare,
|
||||
...response,
|
||||
type: "remove-rewardShare",
|
||||
type: 'remove-rewardShare',
|
||||
label: `Remove rewardshare: awaiting confirmation`,
|
||||
labelDone: `Remove rewardshare: success!`,
|
||||
done: false,
|
||||
@@ -442,7 +439,7 @@ export const Minting = ({
|
||||
rej({ message: response.error });
|
||||
})
|
||||
.catch((error) => {
|
||||
rej({ message: error.message || "An error occurred" });
|
||||
rej({ message: error.message || 'An error occurred' });
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
@@ -454,8 +451,8 @@ export const Minting = ({
|
||||
const privateRewardShare = await removeRewardShare(rewardShare);
|
||||
} catch (error) {
|
||||
setInfo({
|
||||
type: "error",
|
||||
message: error?.message || "Unable to remove reward share",
|
||||
type: 'error',
|
||||
message: error?.message || 'Unable to remove reward share',
|
||||
});
|
||||
setOpenSnack(true);
|
||||
} finally {
|
||||
@@ -468,9 +465,9 @@ export const Minting = ({
|
||||
setIsLoading(true);
|
||||
const confirmReceiver = await getNameOrAddress(receiver);
|
||||
if (confirmReceiver.error)
|
||||
throw new Error("Invalid receiver address or name");
|
||||
throw new Error('Invalid receiver address or name');
|
||||
const isInMinterGroup = await checkIfMinterGroup(confirmReceiver);
|
||||
if (!isInMinterGroup) throw new Error("Account not in Minter Group");
|
||||
if (!isInMinterGroup) throw new Error('Account not in Minter Group');
|
||||
const publicKey = await getPublicKeyFromAddress(confirmReceiver);
|
||||
const findRewardShare = rewardShares?.find(
|
||||
(item) =>
|
||||
@@ -487,8 +484,8 @@ export const Minting = ({
|
||||
}
|
||||
} catch (error) {
|
||||
setInfo({
|
||||
type: "error",
|
||||
message: error?.message || "Unable to create reward share",
|
||||
type: 'error',
|
||||
message: error?.message || 'Unable to create reward share',
|
||||
});
|
||||
setOpenSnack(true);
|
||||
} finally {
|
||||
@@ -550,11 +547,9 @@ export const Minting = ({
|
||||
(accountInfo?.blocksMinted + accountInfo?.blocksMintedAdjustment);
|
||||
|
||||
let countBlocksString = countBlocks.toString();
|
||||
return "" + countBlocksString;
|
||||
return '' + countBlocksString;
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={true}
|
||||
@@ -562,19 +557,19 @@ export const Minting = ({
|
||||
fullWidth
|
||||
fullScreen
|
||||
sx={{
|
||||
"& .MuiDialog-paper": {
|
||||
'& .MuiDialog-paper': {
|
||||
margin: 0,
|
||||
maxWidth: "100%",
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
overflow: "hidden", // Prevent scrollbars
|
||||
maxWidth: '100%',
|
||||
width: '100%',
|
||||
height: '100vh',
|
||||
overflow: 'hidden', // Prevent scrollbars
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle id="alert-dialog-title">{"Manage your minting"}</DialogTitle>
|
||||
<DialogTitle id="alert-dialog-title">{'Manage your minting'}</DialogTitle>
|
||||
<IconButton
|
||||
sx={{
|
||||
position: "absolute",
|
||||
position: 'absolute',
|
||||
right: 8,
|
||||
top: 8,
|
||||
}}
|
||||
@@ -586,20 +581,20 @@ export const Minting = ({
|
||||
</IconButton>
|
||||
<DialogContent
|
||||
sx={{
|
||||
position: "relative",
|
||||
position: 'relative',
|
||||
}}
|
||||
>
|
||||
{isLoading && (
|
||||
<Box
|
||||
sx={{
|
||||
position: "absolute",
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<FidgetSpinner
|
||||
@@ -614,8 +609,8 @@ export const Minting = ({
|
||||
)}
|
||||
<Card
|
||||
sx={{
|
||||
backgroundColor: "var(--bg-2)",
|
||||
padding: "10px",
|
||||
backgroundColor: 'var(--bg-2)',
|
||||
padding: '10px',
|
||||
}}
|
||||
>
|
||||
<Typography>Account: {handleNames(accountInfo?.address)}</Typography>
|
||||
@@ -631,11 +626,11 @@ export const Minting = ({
|
||||
{isPartOfMintingGroup && !accountIsMinting && (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
gap: "5px",
|
||||
flexDirection: "column",
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
display: 'flex',
|
||||
gap: '5px',
|
||||
flexDirection: 'column',
|
||||
width: '100%',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
@@ -645,15 +640,15 @@ export const Minting = ({
|
||||
}}
|
||||
disabled={mintingAccounts?.length > 1}
|
||||
sx={{
|
||||
backgroundColor: "var(--green)",
|
||||
color: "black",
|
||||
fontWeight: "bold",
|
||||
backgroundColor: 'var(--green)',
|
||||
color: 'black',
|
||||
fontWeight: 'bold',
|
||||
opacity: 0.7,
|
||||
maxWidth: "90%",
|
||||
width: "200px",
|
||||
"&:hover": {
|
||||
backgroundColor: "var(--green)",
|
||||
color: "black",
|
||||
maxWidth: '90%',
|
||||
width: '200px',
|
||||
'&:hover': {
|
||||
backgroundColor: 'var(--green)',
|
||||
color: 'black',
|
||||
opacity: 1,
|
||||
},
|
||||
}}
|
||||
@@ -675,16 +670,16 @@ export const Minting = ({
|
||||
)}
|
||||
<Card
|
||||
sx={{
|
||||
backgroundColor: "var(--bg-2)",
|
||||
padding: "10px",
|
||||
backgroundColor: 'var(--bg-2)',
|
||||
padding: '10px',
|
||||
}}
|
||||
>
|
||||
{accountIsMinting && (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
gap: "5px",
|
||||
flexDirection: "column",
|
||||
display: 'flex',
|
||||
gap: '5px',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<Typography>
|
||||
@@ -698,9 +693,9 @@ export const Minting = ({
|
||||
<Box
|
||||
key={acct?.mintingAccount}
|
||||
sx={{
|
||||
display: "flex",
|
||||
gap: "10px",
|
||||
flexDirection: "column",
|
||||
display: 'flex',
|
||||
gap: '10px',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<Typography>
|
||||
@@ -709,15 +704,15 @@ export const Minting = ({
|
||||
<Button
|
||||
size="small"
|
||||
sx={{
|
||||
backgroundColor: "var(--danger)",
|
||||
color: "black",
|
||||
fontWeight: "bold",
|
||||
backgroundColor: 'var(--danger)',
|
||||
color: 'black',
|
||||
fontWeight: 'bold',
|
||||
opacity: 0.7,
|
||||
maxWidth: "90%",
|
||||
width: "200px",
|
||||
"&:hover": {
|
||||
backgroundColor: "var(--danger)",
|
||||
color: "black",
|
||||
maxWidth: '90%',
|
||||
width: '200px',
|
||||
'&:hover': {
|
||||
backgroundColor: 'var(--danger)',
|
||||
color: 'black',
|
||||
opacity: 1,
|
||||
},
|
||||
}}
|
||||
@@ -745,17 +740,17 @@ export const Minting = ({
|
||||
{!isPartOfMintingGroup && (
|
||||
<Card
|
||||
sx={{
|
||||
backgroundColor: "var(--bg-2)",
|
||||
padding: "10px",
|
||||
backgroundColor: 'var(--bg-2)',
|
||||
padding: '10px',
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
gap: "5px",
|
||||
flexDirection: "column",
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
display: 'flex',
|
||||
gap: '5px',
|
||||
flexDirection: 'column',
|
||||
width: '100%',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Typography>
|
||||
@@ -768,22 +763,22 @@ export const Minting = ({
|
||||
<Button
|
||||
size="small"
|
||||
sx={{
|
||||
backgroundColor: "var(--green)",
|
||||
color: "black",
|
||||
fontWeight: "bold",
|
||||
backgroundColor: 'var(--green)',
|
||||
color: 'black',
|
||||
fontWeight: 'bold',
|
||||
opacity: 0.7,
|
||||
|
||||
"&:hover": {
|
||||
backgroundColor: "var(--green)",
|
||||
color: "black",
|
||||
'&:hover': {
|
||||
backgroundColor: 'var(--green)',
|
||||
color: 'black',
|
||||
opacity: 1,
|
||||
},
|
||||
}}
|
||||
onClick={() => {
|
||||
executeEvent("addTab", {
|
||||
data: { service: "APP", name: "q-mintership" },
|
||||
executeEvent('addTab', {
|
||||
data: { service: 'APP', name: 'q-mintership' },
|
||||
});
|
||||
executeEvent("open-apps-mode", {});
|
||||
executeEvent('open-apps-mode', {});
|
||||
setIsOpenMinting(false);
|
||||
}}
|
||||
variant="contained"
|
||||
@@ -801,29 +796,32 @@ export const Minting = ({
|
||||
aria-describedby="alert-dialog-description"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-title">
|
||||
{isShowNext ? "Confirmed" : "Please Wait"}
|
||||
{isShowNext ? 'Confirmed' : 'Please Wait'}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
{!isShowNext && (
|
||||
<Typography>
|
||||
Confirming creation of rewardshare on chain. Please be patient, this could take up to 90 seconds.
|
||||
</Typography>
|
||||
Confirming creation of rewardshare on chain. Please be
|
||||
patient, this could take up to 90 seconds.
|
||||
</Typography>
|
||||
)}
|
||||
{isShowNext && (
|
||||
<Typography>
|
||||
Rewardshare confirmed. Please click Next.
|
||||
</Typography>
|
||||
Rewardshare confirmed. Please click Next.
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button disabled={!isShowNext} variant="contained" onClick={onOk} autoFocus>
|
||||
|
||||
<DialogActions>
|
||||
<Button
|
||||
disabled={!isShowNext}
|
||||
variant="contained"
|
||||
onClick={onOk}
|
||||
autoFocus
|
||||
>
|
||||
Next
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
|
||||
</Dialog>
|
||||
)}
|
||||
</DialogContent>
|
||||
@@ -837,7 +835,7 @@ export const Minting = ({
|
||||
</Button>
|
||||
</DialogActions>
|
||||
<Snackbar
|
||||
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
|
||||
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
||||
open={openSnack}
|
||||
autoHideDuration={6000}
|
||||
onClose={handleClose}
|
||||
@@ -846,7 +844,7 @@ export const Minting = ({
|
||||
onClose={handleClose}
|
||||
severity={info?.type}
|
||||
variant="filled"
|
||||
sx={{ width: "100%" }}
|
||||
sx={{ width: '100%' }}
|
||||
>
|
||||
{info?.message}
|
||||
</Alert>
|
||||
|
Reference in New Issue
Block a user