From 5dd4ccf7499f8c469f0e236602d03e07a29a0f1f Mon Sep 17 00:00:00 2001 From: Asgeir Date: Tue, 5 Jul 2022 16:35:48 +0200 Subject: [PATCH] Remove logging + Unused component + Fix nested `Typography` components --- packages/app/src/App.tsx | 2 - .../components/views/wallet/SelectNetwork.tsx | 3 -- .../components/views/wallet/WalletView.tsx | 53 +++++++++---------- packages/app/src/services/graphql.ts | 1 - 4 files changed, 26 insertions(+), 33 deletions(-) delete mode 100644 packages/app/src/components/views/wallet/SelectNetwork.tsx diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index a6c7ee64..313d4be7 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -16,7 +16,6 @@ import { subgraphClient } from "./services/graphql" import { PermissionView } from "./components/views/publication/PermissionView" import SetupIpfsView from "./components/views/pinning/SetupIpfsView" import { useWeb3React } from "@web3-react/core" -import { SelectNetwork } from "./components/views/wallet/SelectNetwork" import { PosterProvider } from "./services/poster/context" import { WalletProvider } from "./connectors/WalletProvider" @@ -51,7 +50,6 @@ const App: React.FC = () => { } /> } /> - } /> } /> } /> diff --git a/packages/app/src/components/views/wallet/SelectNetwork.tsx b/packages/app/src/components/views/wallet/SelectNetwork.tsx deleted file mode 100644 index 5e2a7e53..00000000 --- a/packages/app/src/components/views/wallet/SelectNetwork.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react" - -export const SelectNetwork: React.FC = () =>

Select a supported network here

diff --git a/packages/app/src/components/views/wallet/WalletView.tsx b/packages/app/src/components/views/wallet/WalletView.tsx index b56093ac..76657446 100644 --- a/packages/app/src/components/views/wallet/WalletView.tsx +++ b/packages/app/src/components/views/wallet/WalletView.tsx @@ -1,5 +1,5 @@ import { Box, Grid, Link, Modal, styled, Typography } from "@mui/material" -import React, { useEffect, useRef, useState } from "react" +import React, { useEffect, useState, useRef } from "react" import { palette, typography } from "../../../theme" import CloseIcon from "@mui/icons-material/Close" import { useLocation, useNavigate } from "react-router-dom" @@ -84,7 +84,7 @@ export const WalletView: React.FC = () => { } await activate(connector, undefined, true).catch((error) => { if (error instanceof UnsupportedChainIdError && connector) { - console.error(error) + console.warn(error.message) setShowModal(true) } }) @@ -137,33 +137,32 @@ export const WalletView: React.FC = () => { - - {publicationChainId != null ? ( - - This publication is on {chainToString(publicationChainId)}. Please change your wallet to that - network. + {publicationChainId != null ? ( + + This publication is on {chainToString(publicationChainId)}. Please change your wallet to that + network. + + ) : ( + + + Please, change to one of the supported networks: - ) : ( - - Please, change to one of the supported networks: - - {ALL_SUPPORTED_CHAIN_IDS.map((chainId) => ( - - connector != null && - switchChain(connector, chainId).then(() => handleConnector(connector)) - } - style={{ cursor: "pointer" }} - > - {chainToString(Number(chainId))} - - ))} - + + {ALL_SUPPORTED_CHAIN_IDS.map((chainId) => ( + + connector != null && switchChain(connector, chainId).then(() => handleConnector(connector)) + } + style={{ cursor: "pointer" }} + > + {chainToString(Number(chainId))} + + ))} - )} - + + )} diff --git a/packages/app/src/services/graphql.ts b/packages/app/src/services/graphql.ts index 927992fb..3a460e0b 100644 --- a/packages/app/src/services/graphql.ts +++ b/packages/app/src/services/graphql.ts @@ -20,7 +20,6 @@ const SUBGRAPH_RINKEBY = process.env.REACT_APP_SUBGRAPH_RINKEBY const SUBGRAPH_MAINNET = process.env.REACT_APP_SUBGRAPH_MAINNET const getUrl = (chainId?: number) => { - console.log(`Chain Id is: ${chainId}`) if (chainId === SupportedChainId.MAINNET) { return BASE_SUBGRAPH_URL + SUBGRAPH_MAINNET }