Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Jan 10, 2024
1 parent 1fb2b05 commit f0e01ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions web/src/components/DisputePreview/Alias.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const AliasContainer = styled.div`
gap: 8px;
align-items: center;
`;

const TextContainer = styled.div`
display: flex;
> label {
Expand All @@ -26,17 +27,14 @@ interface IAlias {
}

const AliasDisplay: React.FC<IAlias> = ({ 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 (
<AliasContainer>
Expand Down
4 changes: 2 additions & 2 deletions web/src/utils/wrapWithToast.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -19,7 +19,7 @@ type WrapWithToastReturnType = {

export async function wrapWithToast(
contractWrite: () => Promise<`0x${string}`>,
publicClient: any
publicClient: PublicClient
): Promise<WrapWithToastReturnType> {
toast.info("Transaction initiated", OPTIONS);
return await contractWrite()
Expand Down

0 comments on commit f0e01ec

Please sign in to comment.