Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: temporarily hardcode subgraph urls #5074

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ const FooterStyled = styled.footer`
align-items: center;
box-sizing: border-box;
font-size: 1.2rem;
flex: 1 1 auto;
color: ${({ theme }): string => theme.textSecondary2};
width: 100%;
justify-content: space-around;
margin: auto auto 0;
height: auto;
padding: 1rem;
max-height: 4rem;
height: 4rem;
position: fixed;
left: 0;
bottom: 0;
z-index: 10;

${Media.upToMedium()} {
margin: 0 auto;
position: relative;
margin: 0;
flex-flow: column wrap;
padding: 1.6rem 1.6rem 4rem;
justify-content: flex-start;
gap: 1.6rem;
bottom: initial;
max-height: initial;
height: auto;
max-height: none;
}

> a {
Expand Down
32 changes: 28 additions & 4 deletions apps/explorer/src/components/layout/GenericLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
import { PropsWithChildren } from 'react'

import { ThemeProvider, StaticGlobalStyle, ThemedGlobalStyle } from 'theme'
import { Media } from '@cowprotocol/ui'

import styled from 'styled-components/macro'
import { StaticGlobalStyle, ThemedGlobalStyle, ThemeProvider } from 'theme'

import { Footer } from './Footer'
import { Header } from './Header'

const PageWrapper = styled.div`
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
`

const MainContent = styled.main`
flex: 1;
padding-bottom: 5rem;
width: 100%;

${Media.upToMedium()} {
padding-bottom: 0;
}
`

export type Props = PropsWithChildren<{
header?: React.ReactNode | null
footer?: React.ReactNode | null
Expand All @@ -18,9 +38,13 @@ export const GenericLayout: React.FC<Props> = ({ header = defaultHeader, footer
<StaticGlobalStyle />
<ThemeProvider>
<ThemedGlobalStyle />
{header}
{children}
{footer}
<PageWrapper>
{header}
<MainContent>
{children}
</MainContent>
{footer}
</PageWrapper>
</ThemeProvider>
</>
)
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/src/components/token/TokenTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ const TokenTable: React.FC<Props> = (props) => {
} else {
tableContent = (
<>
<tr>
{/* <tr>
<td>Sorted by Volume(24h): from highest to lowest</td>
</tr>
</tr> */}
{items.map((item, i) => (
<RowToken key={`${item.id}-${i}`} index={i + tableState.pageOffset} token={item} />
))}
Expand Down
12 changes: 8 additions & 4 deletions apps/explorer/src/consts/subgraphUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ function getSubgraphUrl(chainId: SupportedChainId, suffix: string): string | nul
* When value is null, then Subgraph is not supported for the network
*/
export const SUBGRAPH_URLS: Record<SupportedChainId, string | null> = {
[SupportedChainId.MAINNET]: getSubgraphUrl(SupportedChainId.MAINNET, 'MAINNET'),
[SupportedChainId.GNOSIS_CHAIN]: getSubgraphUrl(SupportedChainId.GNOSIS_CHAIN, 'GNOSIS_CHAIN'),
[SupportedChainId.ARBITRUM_ONE]: getSubgraphUrl(SupportedChainId.ARBITRUM_ONE, 'ARBITRUM_ONE'),
[SupportedChainId.MAINNET]:
'https://subgraph.satsuma-prod.com/a29a417e85ec/cow-nomev-labs-pt516811924/cow-subgraph-mainnet/api',
[SupportedChainId.GNOSIS_CHAIN]:
'https://subgraph.satsuma-prod.com/a29a417e85ec/cow-nomev-labs-pt516811924/cow-subgraphs-gnosis/api',
[SupportedChainId.ARBITRUM_ONE]:
'https://subgraph.satsuma-prod.com/a29a417e85ec/cow-nomev-labs-pt516811924/cow-subgraph-arb/api',
[SupportedChainId.BASE]: getSubgraphUrl(SupportedChainId.BASE, 'BASE'),
[SupportedChainId.SEPOLIA]: getSubgraphUrl(SupportedChainId.SEPOLIA, 'SEPOLIA'),
[SupportedChainId.SEPOLIA]:
'https://subgraph.satsuma-prod.com/a29a417e85ec/cow-nomev-labs-pt516811924/cow-subgraph-sepolia/api',
Comment on lines +11 to +19
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these to SDK/env vars

}
16 changes: 11 additions & 5 deletions apps/explorer/src/explorer/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import { Wrapper as WrapperMod } from '../styled'
const Wrapper = styled(WrapperMod)`
max-width: 100%;
height: calc(100vh - 10rem);
flex-flow: column wrap;
justify-content: center;
display: flex;
padding: 0;

${Media.upToMedium()} {
Expand All @@ -30,9 +27,16 @@ const Wrapper = styled(WrapperMod)`
${Media.upToSmall()} {
padding: 0 1.6rem;
}
`

const SearchWrapper = styled.div`
flex-flow: column wrap;
justify-content: center;
display: flex;

> h1 {
justify-content: center;
text-align: center;
padding: 2.4rem 0 0.75rem;
margin: 0 0 2.4rem;
font-size: 2.4rem;
Expand Down Expand Up @@ -82,8 +86,10 @@ export const Home: React.FC = () => {
<Helmet>
<title>{APP_TITLE}</title>
</Helmet>
<h1>Search on CoW Protocol Explorer</h1>
<Search className="home" />
<SearchWrapper>
<h1>Search on CoW Protocol Explorer</h1>
<Search className="home" />
</SearchWrapper>
<SummaryWrapper>
{showCharts && (
<>
Expand Down
Loading