344b4340ae
* deleting some code first * strict, some refactoring * denser common bases * more add liquidity refactoring * add liquidity paths working * show common bases in the token selects * fix the ability to select duplicate tokens * useless rename * try to handle alllll the duplicate token edge cases * think i got them all lol * remove common bases header * Revert "remove common bases header" This reverts commit 6ac4565d * fix and add integration tests * make gap between rows smaller * get integration tests actually running again * try another format of the command, upgrade serve * frozen lockfile on install * try the cypress github action * install cypress in ci * remove redundant ignore-scripts command * use a specific github commit for the pinata action * fix a bug in the multicall reducer, improve token list rendering performance * improve the enter key on the token search modal * stop using history.push * fix linting errors * position card cleanup before updating to match mock
96 lines
3.3 KiB
TypeScript
96 lines
3.3 KiB
TypeScript
import React, { Suspense } from 'react'
|
|
import { HashRouter, Route, Switch } from 'react-router-dom'
|
|
import styled from 'styled-components'
|
|
import GoogleAnalyticsReporter from '../components/analytics/GoogleAnalyticsReporter'
|
|
import Header from '../components/Header'
|
|
import Popups from '../components/Popups'
|
|
import Web3ReactManager from '../components/Web3ReactManager'
|
|
import DarkModeQueryParamReader from '../theme/DarkModeQueryParamReader'
|
|
import AddLiquidity from './AddLiquidity'
|
|
import {
|
|
RedirectDuplicateTokenIds,
|
|
RedirectOldAddLiquidityPathStructure,
|
|
RedirectToAddLiquidity
|
|
} from './AddLiquidity/redirects'
|
|
import MigrateV1 from './MigrateV1'
|
|
import MigrateV1Exchange from './MigrateV1/MigrateV1Exchange'
|
|
import RemoveV1Exchange from './MigrateV1/RemoveV1Exchange'
|
|
import Pool from './Pool'
|
|
import PoolFinder from './PoolFinder'
|
|
import RemoveLiquidity from './RemoveLiquidity'
|
|
import Swap from './Swap'
|
|
import { RedirectPathToSwapOnly, RedirectToSwap } from './Swap/redirects'
|
|
|
|
const AppWrapper = styled.div`
|
|
display: flex;
|
|
flex-flow: column;
|
|
align-items: flex-start;
|
|
overflow-x: hidden;
|
|
`
|
|
|
|
const HeaderWrapper = styled.div`
|
|
${({ theme }) => theme.flexRowNoWrap}
|
|
width: 100%;
|
|
justify-content: space-between;
|
|
`
|
|
|
|
const BodyWrapper = styled.div`
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 100%;
|
|
padding-top: 160px;
|
|
align-items: center;
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
z-index: 10;
|
|
|
|
${({ theme }) => theme.mediaWidth.upToExtraSmall`
|
|
padding: 16px;
|
|
`};
|
|
|
|
z-index: 1;
|
|
`
|
|
|
|
const Marginer = styled.div`
|
|
margin-top: 5rem;
|
|
`
|
|
|
|
export default function App() {
|
|
return (
|
|
<Suspense fallback={null}>
|
|
<HashRouter>
|
|
<Route component={GoogleAnalyticsReporter} />
|
|
<Route component={DarkModeQueryParamReader} />
|
|
<AppWrapper>
|
|
<HeaderWrapper>
|
|
<Header />
|
|
</HeaderWrapper>
|
|
<BodyWrapper>
|
|
<Popups />
|
|
<Web3ReactManager>
|
|
<Switch>
|
|
<Route exact strict path="/swap" component={Swap} />
|
|
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
|
|
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
|
|
<Route exact strict path="/find" component={PoolFinder} />
|
|
<Route exact strict path="/pool" component={Pool} />
|
|
<Route exact strict path="/create" component={RedirectToAddLiquidity} />
|
|
<Route exact path="/add" component={AddLiquidity} />
|
|
<Route exact path="/add/:currencyIdA" component={RedirectOldAddLiquidityPathStructure} />
|
|
<Route exact path="/add/:currencyIdA/:currencyIdB" component={RedirectDuplicateTokenIds} />
|
|
<Route exact strict path="/remove/:tokens" component={RemoveLiquidity} />
|
|
<Route exact strict path="/migrate/v1" component={MigrateV1} />
|
|
<Route exact strict path="/migrate/v1/:address" component={MigrateV1Exchange} />
|
|
<Route exact strict path="/remove/v1/:address" component={RemoveV1Exchange} />
|
|
<Route component={RedirectPathToSwapOnly} />
|
|
</Switch>
|
|
</Web3ReactManager>
|
|
<Marginer />
|
|
</BodyWrapper>
|
|
</AppWrapper>
|
|
</HashRouter>
|
|
</Suspense>
|
|
)
|
|
}
|