Skip to content

Commit

Permalink
Remove logging + Unused component + Fix nested Typography components
Browse files Browse the repository at this point in the history
  • Loading branch information
asgeir-s committed Jul 5, 2022
1 parent ea70363 commit 5dd4ccf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 33 deletions.
2 changes: 0 additions & 2 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -51,7 +50,6 @@ const App: React.FC = () => {
<Routes>
<Route path="/" element={<LandingView />} />
<Route path="/wallet" element={<WalletView />} />
<Route path="/select-network" element={<SelectNetwork />} />
<Route path="/pinning" element={<SetupIpfsView />} />
<Route path="/publication/publish" element={<PublishView updateChainId={updateChainId} />} />

Expand Down
3 changes: 0 additions & 3 deletions packages/app/src/components/views/wallet/SelectNetwork.tsx

This file was deleted.

53 changes: 26 additions & 27 deletions packages/app/src/components/views/wallet/WalletView.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
}
})
Expand Down Expand Up @@ -137,33 +137,32 @@ export const WalletView: React.FC = () => {
</Grid>
<Grid item>
<ModalContentContainer>
<Typography variant="body1" fontWeight={700} color={palette.secondary[1000]}>
{publicationChainId != null ? (
<Typography>
This publication is on {chainToString(publicationChainId)}. Please change your wallet to that
network.
{publicationChainId != null ? (
<Typography variant="body1" fontWeight={700} color={palette.secondary[1000]}>
This publication is on {chainToString(publicationChainId)}. Please change your wallet to that
network.
</Typography>
) : (
<Grid item>
<Typography variant="body1" fontWeight={700} color={palette.secondary[1000]}>
Please, change to one of the supported networks:
</Typography>
) : (
<Grid item>
<Typography>Please, change to one of the supported networks:</Typography>
<Grid container flexDirection="column" gap={1}>
{ALL_SUPPORTED_CHAIN_IDS.map((chainId) => (
<Grid
item
key={chainId}
onClick={() =>
connector != null &&
switchChain(connector, chainId).then(() => handleConnector(connector))
}
style={{ cursor: "pointer" }}
>
<Link>{chainToString(Number(chainId))}</Link>
</Grid>
))}
</Grid>
<Grid container flexDirection="column" gap={1}>
{ALL_SUPPORTED_CHAIN_IDS.map((chainId) => (
<Grid
item
key={chainId}
onClick={() =>
connector != null && switchChain(connector, chainId).then(() => handleConnector(connector))
}
style={{ cursor: "pointer" }}
>
<Link>{chainToString(Number(chainId))}</Link>
</Grid>
))}
</Grid>
)}
</Typography>
</Grid>
)}
</ModalContentContainer>
</Grid>
</Grid>
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/services/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 5dd4ccf

Please sign in to comment.