chore: cleanup

This commit is contained in:
Ben Kremer 2022-02-17 11:29:38 +01:00
parent 61148c8c04
commit f3c9a9bdcf
3 changed files with 4 additions and 25 deletions

View File

@ -11,13 +11,11 @@ import { DEFAULT_MAIN_CHAINS, DEFAULT_TEST_CHAINS } from "./constants";
import { AccountAction, getLocalStorageTestnetFlag, setLocaleStorageTestnetFlag } from "./helpers"; import { AccountAction, getLocalStorageTestnetFlag, setLocaleStorageTestnetFlag } from "./helpers";
import Toggle from "./components/Toggle"; import Toggle from "./components/Toggle";
import RequestModal from "./modals/RequestModal"; import RequestModal from "./modals/RequestModal";
import PairingModal from "./modals/PairingModal";
import PingModal from "./modals/PingModal"; import PingModal from "./modals/PingModal";
import { import {
SAccounts, SAccounts,
SAccountsContainer, SAccountsContainer,
SButtonContainer, SButtonContainer,
SConnectButton,
SContent, SContent,
SLanding, SLanding,
SLayout, SLayout,
@ -41,13 +39,11 @@ export default function App() {
const [modal, setModal] = useState(""); const [modal, setModal] = useState("");
const closeModal = () => setModal(""); const closeModal = () => setModal("");
const openPairingModal = () => setModal("pairing"); // const openPingModal = () => setModal("ping");
const openPingModal = () => setModal("ping");
const openRequestModal = () => setModal("request"); const openRequestModal = () => setModal("request");
// Initialize the WalletConnect client. // Initialize the WalletConnect client.
const { const {
client,
session, session,
disconnect, disconnect,
chain, chain,
@ -190,12 +186,6 @@ export default function App() {
// Renders the appropriate model for the given request that is currently in-flight. // Renders the appropriate model for the given request that is currently in-flight.
const renderModal = () => { const renderModal = () => {
switch (modal) { switch (modal) {
case "pairing":
if (typeof client === "undefined") {
throw new Error("WalletConnect is not initialized");
}
// return <PairingModal pairings={client.pairing.values} connect={onEnable} />;
return null;
case "request": case "request":
return <RequestModal pending={isRpcRequestPending} result={rpcResult} />; return <RequestModal pending={isRpcRequestPending} result={rpcResult} />;
case "ping": case "ping":
@ -222,9 +212,6 @@ export default function App() {
{chainOptions.map(chainId => ( {chainOptions.map(chainId => (
<Blockchain key={chainId} chainId={chainId} chainData={chainData} onClick={onEnable} /> <Blockchain key={chainId} chainId={chainId} chainData={chainData} onClick={onEnable} />
))} ))}
{/* <SConnectButton left onClick={onEnable} disabled={!chains.length}>
{"Connect"}
</SConnectButton> */}
</SButtonContainer> </SButtonContainer>
</SLanding> </SLanding>
) : ( ) : (

View File

@ -3,7 +3,7 @@ import styled from "styled-components";
import Icon from "./Icon"; import Icon from "./Icon";
import { AssetData, fromWad } from "../helpers"; import { AssetData } from "../helpers";
import eth from "../assets/eth.svg"; import eth from "../assets/eth.svg";
import erc20 from "../assets/erc20.svg"; import erc20 from "../assets/erc20.svg";
@ -35,6 +35,7 @@ const SAssetBalance = styled.div`
display: flex; display: flex;
`; `;
// eslint-disable-next-line
function getAssetIcon(asset: AssetData): JSX.Element { function getAssetIcon(asset: AssetData): JSX.Element {
if (!!asset.contractAddress) { if (!!asset.contractAddress) {
const src = `https://raw.githubusercontent.com/TrustWallet/tokens/master/tokens/${asset.contractAddress.toLowerCase()}.png`; const src = `https://raw.githubusercontent.com/TrustWallet/tokens/master/tokens/${asset.contractAddress.toLowerCase()}.png`;

View File

@ -8,13 +8,7 @@ import Column from "./Column";
import Loader from "./Loader"; import Loader from "./Loader";
import { getChainMetadata } from "../chains"; import { getChainMetadata } from "../chains";
import { import { AccountAction, ellipseAddress, ChainMetadata, ChainNamespaces } from "../helpers";
AccountAction,
ellipseAddress,
AccountBalances,
ChainMetadata,
ChainNamespaces,
} from "../helpers";
import { fonts } from "../styles"; import { fonts } from "../styles";
interface AccountStyleProps { interface AccountStyleProps {
@ -125,9 +119,6 @@ const Blockchain: FC<PropsWithChildren<BlockchainProps>> = (
return null; return null;
} }
const name = chain.meta.name || chain.data.name; 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 ( return (
<React.Fragment> <React.Fragment>