From f3c9a9bdcf1faea00729d07e5f0740568810a8b7 Mon Sep 17 00:00:00 2001 From: Ben Kremer Date: Thu, 17 Feb 2022 11:29:38 +0100 Subject: [PATCH] chore: cleanup --- dapps/react-dapp-v2-with-ethers/src/App.tsx | 15 +-------------- .../src/components/Asset.tsx | 3 ++- .../src/components/Blockchain.tsx | 11 +---------- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/dapps/react-dapp-v2-with-ethers/src/App.tsx b/dapps/react-dapp-v2-with-ethers/src/App.tsx index 086115e..994b319 100644 --- a/dapps/react-dapp-v2-with-ethers/src/App.tsx +++ b/dapps/react-dapp-v2-with-ethers/src/App.tsx @@ -11,13 +11,11 @@ import { DEFAULT_MAIN_CHAINS, DEFAULT_TEST_CHAINS } from "./constants"; import { AccountAction, getLocalStorageTestnetFlag, setLocaleStorageTestnetFlag } from "./helpers"; import Toggle from "./components/Toggle"; import RequestModal from "./modals/RequestModal"; -import PairingModal from "./modals/PairingModal"; import PingModal from "./modals/PingModal"; import { SAccounts, SAccountsContainer, SButtonContainer, - SConnectButton, SContent, SLanding, SLayout, @@ -41,13 +39,11 @@ export default function App() { const [modal, setModal] = useState(""); const closeModal = () => setModal(""); - const openPairingModal = () => setModal("pairing"); - const openPingModal = () => setModal("ping"); + // const openPingModal = () => setModal("ping"); const openRequestModal = () => setModal("request"); // Initialize the WalletConnect client. const { - client, session, disconnect, chain, @@ -190,12 +186,6 @@ export default function App() { // Renders the appropriate model for the given request that is currently in-flight. const renderModal = () => { switch (modal) { - case "pairing": - if (typeof client === "undefined") { - throw new Error("WalletConnect is not initialized"); - } - // return ; - return null; case "request": return ; case "ping": @@ -222,9 +212,6 @@ export default function App() { {chainOptions.map(chainId => ( ))} - {/* - {"Connect"} - */} ) : ( diff --git a/dapps/react-dapp-v2-with-ethers/src/components/Asset.tsx b/dapps/react-dapp-v2-with-ethers/src/components/Asset.tsx index 37f5ee6..b34af10 100644 --- a/dapps/react-dapp-v2-with-ethers/src/components/Asset.tsx +++ b/dapps/react-dapp-v2-with-ethers/src/components/Asset.tsx @@ -3,7 +3,7 @@ import styled from "styled-components"; import Icon from "./Icon"; -import { AssetData, fromWad } from "../helpers"; +import { AssetData } from "../helpers"; import eth from "../assets/eth.svg"; import erc20 from "../assets/erc20.svg"; @@ -35,6 +35,7 @@ const SAssetBalance = styled.div` display: flex; `; +// eslint-disable-next-line function getAssetIcon(asset: AssetData): JSX.Element { if (!!asset.contractAddress) { const src = `https://raw.githubusercontent.com/TrustWallet/tokens/master/tokens/${asset.contractAddress.toLowerCase()}.png`; diff --git a/dapps/react-dapp-v2-with-ethers/src/components/Blockchain.tsx b/dapps/react-dapp-v2-with-ethers/src/components/Blockchain.tsx index 23545c9..8618ff1 100644 --- a/dapps/react-dapp-v2-with-ethers/src/components/Blockchain.tsx +++ b/dapps/react-dapp-v2-with-ethers/src/components/Blockchain.tsx @@ -8,13 +8,7 @@ import Column from "./Column"; import Loader from "./Loader"; import { getChainMetadata } from "../chains"; -import { - AccountAction, - ellipseAddress, - AccountBalances, - ChainMetadata, - ChainNamespaces, -} from "../helpers"; +import { AccountAction, ellipseAddress, ChainMetadata, ChainNamespaces } from "../helpers"; import { fonts } from "../styles"; interface AccountStyleProps { @@ -125,9 +119,6 @@ const Blockchain: FC> = ( return null; } const name = chain.meta.name || chain.data.name; - const account = typeof address !== "undefined" ? `${chainId}:${address}` : undefined; - // const assets = - // typeof account !== "undefined" && typeof balances !== "undefined" ? balances[account] : []; return (