From 1d8e079e736929190a276a7ed51fb2a729c67a1b Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Thu, 8 Dec 2022 17:38:38 -0800 Subject: [PATCH] Run eslint on App.tsx --- src/App.tsx | 121 ++++++++++++++++++++++++++-------------------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 665d2a7..d7a4f02 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,12 +1,11 @@ -import React, {useState} from 'react'; -import logo from './logo.svg'; -import './App.css'; +import React, {useState} from "react"; +import "./App.css"; -import Web3 from 'web3'; -import { WagmiConfig, createClient, configureChains, mainnet, useConnect, useAccount, useDisconnect } from 'wagmi' +import Web3 from "web3"; +import { WagmiConfig, createClient, configureChains, mainnet, useConnect, useAccount, useDisconnect } from "wagmi" -import { MetaMaskConnector } from 'wagmi/connectors/metaMask' -import { publicProvider } from 'wagmi/providers/public' +import { MetaMaskConnector } from "wagmi/connectors/metaMask" +import { publicProvider } from "wagmi/providers/public" const web3 = new Web3(Web3.givenProvider); @@ -23,17 +22,17 @@ const airdropContract = new web3.eth.Contract(Airdrop.abi as any, airdropAddress const { chains, provider, webSocketProvider } = configureChains([mainnet], [publicProvider()]); const wagmiClient = createClient({ - autoConnect: true, - connectors: [ - new MetaMaskConnector({ chains }), - ], - provider, - webSocketProvider, + autoConnect: true, + connectors: [ + new MetaMaskConnector({ chains }), + ], + provider, + webSocketProvider, }) function Profile() { - const { connect, connectors, error, isLoading, pendingConnector } = + const { connect, connectors, error, isLoading, pendingConnector } = useConnect() const { address, connector, isConnected } = useAccount() @@ -41,34 +40,34 @@ function Profile() { if (isConnected) { const connectorName = connector?.name || "unknown connector"; - return ( -
-
Connected to {connectorName} address: {address}
- -
- ) - } + return ( +
+
Connected to {connectorName} address: {address}
+ +
+ ) + } - return ( -
-
Connect to Airdrop App
- {connectors.map((connector) => ( - - ))} + " (connecting)"} + + ))} - {error &&
{error.message}
} -
- ) + {error &&
{error.message}
} + + ) } @@ -110,17 +109,17 @@ function Addresses(props: AddressesProps) { } return ( -
-
- setInputState(evt.target.value) } > -
{errorText}
- -
+
+ setInputState(evt.target.value) } > +
{errorText}
+ +
+
Number of tokens: - setNumTokens(parseInt(evt.target.value)) }> + setNumTokens(parseInt(evt.target.value)) }> +
-
); } @@ -131,8 +130,8 @@ interface AddressListProps { function AddressList({addressList}: AddressListProps) { const addresses = addressList.length == 0 ? -

No addresses specified yet

: - addressList.map((addr: string) =>
{addr}
); +

No addresses specified yet

: + addressList.map((addr: string) =>
{addr}
); return (

Addresses to airdrop to:

@@ -175,21 +174,21 @@ function App() { const airdropButtonDisabled = addressList.length == 0 || !isConnected; - return ( - -
- + return ( + +
+ -

Airdrop App

+

Airdrop App

-

Add an address to airdrop to:

- - - +

Add an address to airdrop to:

+ + + -
-
- ); +
+
+ ); } export default App;