Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tower1229 committed Jan 31, 2024
1 parent ce24a17 commit d7b52cf
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions src/pages/game/_components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { useImperativeHandle, forwardRef, useEffect, useState } from "react";
import { useImperativeHandle, forwardRef, useEffect } from "react";
import {
useSwitchChain,
useReadContract,
Expand All @@ -16,8 +16,8 @@ import {
RESULT_DESCRIPTION,
} from "@/constants";
import { dispatch as dispatchGameState, Chain } from "../_utils";
import { getETH } from "@/api/zkp";
import { toast } from "react-toastify";
// import { getETH } from "@/api/zkp";
// import { toast } from "react-toastify";
import { useQueryClient } from "@tanstack/react-query";

const ContractAddress = import.meta.env.VITE_APP_CONTRACT_ADDRESS;
Expand Down Expand Up @@ -106,32 +106,32 @@ const Header = forwardRef((_props, ref) => {
[refetch]
);

const [sendETHLoading, setSendETHLoading] = useState(false);
const sendETH = () => {
if (address && !sendETHLoading) {
setSendETHLoading(true);
void getETH({
ethAddress: address,
})
.then((res) => {
if (res.data.txHash) {
toast.success("Send ETH Success!");
// window.open(
// `${Chain.blockExplorers.default.url}/tx/${res.data.txHash}`
// );
} else {
toast.error("api error!");
}
})
.catch((err) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
toast.error(err?.message || "fetch fail!");
})
.finally(() => {
setSendETHLoading(false);
});
}
};
// const [sendETHLoading, setSendETHLoading] = useState(false);
// const sendETH = () => {
// if (address && !sendETHLoading) {
// setSendETHLoading(true);
// void getETH({
// ethAddress: address,
// })
// .then((res) => {
// if (res.data.txHash) {
// toast.success("Send ETH Success!");
// // window.open(
// // `${Chain.blockExplorers.default.url}/tx/${res.data.txHash}`
// // );
// } else {
// toast.error("api error!");
// }
// })
// .catch((err) => {
// // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
// toast.error(err?.message || "fetch fail!");
// })
// .finally(() => {
// setSendETHLoading(false);
// });
// }
// };

return (
<>
Expand Down Expand Up @@ -286,8 +286,8 @@ const Header = forwardRef((_props, ref) => {
>
<path
d="M9.16488 17.6505C8.92513 17.8743 8.73958 18.0241 8.54996 18.1336C7.62175 18.6695 6.47816 18.6695 5.54996 18.1336C5.20791 17.9361 4.87912 17.6073 4.22153 16.9498C3.56394 16.2922 3.23514 15.9634 3.03767 15.6213C2.50177 14.6931 2.50177 13.5495 3.03767 12.6213C3.23514 12.2793 3.56394 11.9505 4.22153 11.2929L7.04996 8.46448C7.70755 7.80689 8.03634 7.47809 8.37838 7.28062C9.30659 6.74472 10.4502 6.74472 11.3784 7.28061C11.7204 7.47809 12.0492 7.80689 12.7068 8.46448C13.3644 9.12207 13.6932 9.45086 13.8907 9.7929C14.4266 10.7211 14.4266 11.8647 13.8907 12.7929C13.7812 12.9825 13.6314 13.1681 13.4075 13.4078M10.5919 10.5922C10.368 10.8319 10.2182 11.0175 10.1087 11.2071C9.57284 12.1353 9.57284 13.2789 10.1087 14.2071C10.3062 14.5492 10.635 14.878 11.2926 15.5355C11.9502 16.1931 12.279 16.5219 12.621 16.7194C13.5492 17.2553 14.6928 17.2553 15.621 16.7194C15.9631 16.5219 16.2919 16.1931 16.9495 15.5355L19.7779 12.7071C20.4355 12.0495 20.7643 11.7207 20.9617 11.3787C21.4976 10.4505 21.4976 9.30689 20.9617 8.37869C20.7643 8.03665 20.4355 7.70785 19.7779 7.05026C19.1203 6.39267 18.7915 6.06388 18.4495 5.8664C17.5212 5.3305 16.3777 5.3305 15.4495 5.8664C15.2598 5.97588 15.0743 6.12571 14.8345 6.34955"
stroke-width="2"
stroke-linecap="round"
strokeWidth="2"
strokeLinecap="round"
/>
</svg>
Faucet by Alchemy
Expand All @@ -309,8 +309,8 @@ const Header = forwardRef((_props, ref) => {
>
<path
d="M9.16488 17.6505C8.92513 17.8743 8.73958 18.0241 8.54996 18.1336C7.62175 18.6695 6.47816 18.6695 5.54996 18.1336C5.20791 17.9361 4.87912 17.6073 4.22153 16.9498C3.56394 16.2922 3.23514 15.9634 3.03767 15.6213C2.50177 14.6931 2.50177 13.5495 3.03767 12.6213C3.23514 12.2793 3.56394 11.9505 4.22153 11.2929L7.04996 8.46448C7.70755 7.80689 8.03634 7.47809 8.37838 7.28062C9.30659 6.74472 10.4502 6.74472 11.3784 7.28061C11.7204 7.47809 12.0492 7.80689 12.7068 8.46448C13.3644 9.12207 13.6932 9.45086 13.8907 9.7929C14.4266 10.7211 14.4266 11.8647 13.8907 12.7929C13.7812 12.9825 13.6314 13.1681 13.4075 13.4078M10.5919 10.5922C10.368 10.8319 10.2182 11.0175 10.1087 11.2071C9.57284 12.1353 9.57284 13.2789 10.1087 14.2071C10.3062 14.5492 10.635 14.878 11.2926 15.5355C11.9502 16.1931 12.279 16.5219 12.621 16.7194C13.5492 17.2553 14.6928 17.2553 15.621 16.7194C15.9631 16.5219 16.2919 16.1931 16.9495 15.5355L19.7779 12.7071C20.4355 12.0495 20.7643 11.7207 20.9617 11.3787C21.4976 10.4505 21.4976 9.30689 20.9617 8.37869C20.7643 8.03665 20.4355 7.70785 19.7779 7.05026C19.1203 6.39267 18.7915 6.06388 18.4495 5.8664C17.5212 5.3305 16.3777 5.3305 15.4495 5.8664C15.2598 5.97588 15.0743 6.12571 14.8345 6.34955"
stroke-width="2"
stroke-linecap="round"
strokeWidth="2"
strokeLinecap="round"
/>
</svg>
Faucet by QuickNode
Expand Down

0 comments on commit d7b52cf

Please sign in to comment.