Skip to content

Commit

Permalink
fix(explorer): do not show tokens table on gchain (cowprotocol#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito authored Mar 1, 2024
1 parent dd31431 commit 712e6db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/explorer/src/explorer/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { TokensTableWidget } from '../../components/TokensTableWidget'
import { Helmet } from 'react-helmet'
import { APP_TITLE } from '../../const'
import { SUBGRAPH_URLS } from '../../../consts/subgraphUrls'
import { SupportedChainId } from '@cowprotocol/cow-sdk'

const Wrapper = styled(WrapperMod)`
max-width: 140rem;
Expand Down Expand Up @@ -47,10 +48,17 @@ const SummaryWrapper = styled.section`
}
`

const SHOW_TOKENS_TABLE: Record<SupportedChainId, boolean> = {
[SupportedChainId.MAINNET]: true,
[SupportedChainId.GNOSIS_CHAIN]: false, // Gchain data is not reliable
[SupportedChainId.SEPOLIA]: false, // No data for Sepolia
}

export const Home: React.FC = () => {
const networkId = useNetworkId() || undefined

const showCharts = !!networkId && SUBGRAPH_URLS[networkId] !== null
const showTokensTable = !!networkId && SHOW_TOKENS_TABLE[networkId]

return (
<Wrapper>
Expand All @@ -63,7 +71,7 @@ export const Home: React.FC = () => {
{showCharts && (
<>
<StatsSummaryCardsWidget />
<TokensTableWidget networkId={networkId} />
{showTokensTable && <TokensTableWidget networkId={networkId} />}
</>
)}
</SummaryWrapper>
Expand Down

0 comments on commit 712e6db

Please sign in to comment.