From f0e01ec6960c7fe8c3a02bbaca228fa4d77960ee Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 10 Jan 2024 18:10:07 +0000 Subject: [PATCH] fix: linter --- web/src/components/DisputePreview/Alias.tsx | 10 ++++------ web/src/utils/wrapWithToast.ts | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/web/src/components/DisputePreview/Alias.tsx b/web/src/components/DisputePreview/Alias.tsx index c8af4316b..53355aa4f 100644 --- a/web/src/components/DisputePreview/Alias.tsx +++ b/web/src/components/DisputePreview/Alias.tsx @@ -13,6 +13,7 @@ const AliasContainer = styled.div` gap: 8px; align-items: center; `; + const TextContainer = styled.div` display: flex; > label { @@ -26,17 +27,14 @@ interface IAlias { } const AliasDisplay: React.FC = ({ alias }) => { - let address: string; - const { data: addressFromENS, isLoading } = useEnsAddress({ - enabled: !isAddress(alias.address), //if alias.address is not an Address, we treat it as ENS and try to fetch address from there + enabled: !isAddress(alias.address), // if alias.address is not an Address, we treat it as ENS and try to fetch address from there name: alias.address, chainId: 1, }); - //try fetching ens name, else go with address - if (addressFromENS) address = addressFromENS; - else address = alias.address; + // try fetching ens name, else go with address + const address = addressFromENS ?? alias.address; return ( diff --git a/web/src/utils/wrapWithToast.ts b/web/src/utils/wrapWithToast.ts index bd907d396..82bd5a5d1 100644 --- a/web/src/utils/wrapWithToast.ts +++ b/web/src/utils/wrapWithToast.ts @@ -1,5 +1,5 @@ import { toast, ToastPosition, Theme } from "react-toastify"; -import { TransactionReceipt } from "viem"; +import { PublicClient, TransactionReceipt } from "viem"; export const OPTIONS = { position: "top-center" as ToastPosition, @@ -19,7 +19,7 @@ type WrapWithToastReturnType = { export async function wrapWithToast( contractWrite: () => Promise<`0x${string}`>, - publicClient: any + publicClient: PublicClient ): Promise { toast.info("Transaction initiated", OPTIONS); return await contractWrite()