2020-05-19 02:23:58 +03:00
|
|
|
import React, { Suspense } from 'react'
|
2020-06-30 20:41:51 +03:00
|
|
|
import { HashRouter, Route, Switch } from 'react-router-dom'
|
2020-05-19 02:23:58 +03:00
|
|
|
import styled from 'styled-components'
|
|
|
|
import GoogleAnalyticsReporter from '../components/analytics/GoogleAnalyticsReporter'
|
2019-04-15 19:56:40 +03:00
|
|
|
import Header from '../components/Header'
|
2020-04-23 00:22:13 +03:00
|
|
|
import Popups from '../components/Popups'
|
2020-05-19 02:23:58 +03:00
|
|
|
import Web3ReactManager from '../components/Web3ReactManager'
|
|
|
|
import DarkModeQueryParamReader from '../theme/DarkModeQueryParamReader'
|
2020-05-20 22:00:33 +03:00
|
|
|
import AddLiquidity from './AddLiquidity'
|
2020-07-10 22:25:15 +03:00
|
|
|
import {
|
|
|
|
RedirectDuplicateTokenIds,
|
|
|
|
RedirectOldAddLiquidityPathStructure,
|
|
|
|
RedirectToAddLiquidity
|
|
|
|
} from './AddLiquidity/redirects'
|
2020-06-03 21:07:01 +03:00
|
|
|
import MigrateV1 from './MigrateV1'
|
|
|
|
import MigrateV1Exchange from './MigrateV1/MigrateV1Exchange'
|
2020-06-12 21:04:42 +03:00
|
|
|
import RemoveV1Exchange from './MigrateV1/RemoveV1Exchange'
|
2020-05-08 19:05:52 +03:00
|
|
|
import Pool from './Pool'
|
2020-05-20 22:00:33 +03:00
|
|
|
import PoolFinder from './PoolFinder'
|
|
|
|
import RemoveLiquidity from './RemoveLiquidity'
|
2020-07-20 14:48:42 +03:00
|
|
|
import { RedirectOldRemoveLiquidityPathStructure } from './RemoveLiquidity/redirects'
|
2020-05-19 02:23:58 +03:00
|
|
|
import Swap from './Swap'
|
2020-05-20 22:00:33 +03:00
|
|
|
import { RedirectPathToSwapOnly, RedirectToSwap } from './Swap/redirects'
|
2018-10-27 10:54:52 +03:00
|
|
|
|
2019-08-07 21:58:29 +03:00
|
|
|
const AppWrapper = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-flow: column;
|
|
|
|
align-items: flex-start;
|
2020-04-23 00:22:13 +03:00
|
|
|
overflow-x: hidden;
|
2019-08-07 21:58:29 +03:00
|
|
|
`
|
|
|
|
|
2019-05-30 23:42:25 +03:00
|
|
|
const HeaderWrapper = styled.div`
|
|
|
|
${({ theme }) => theme.flexRowNoWrap}
|
|
|
|
width: 100%;
|
|
|
|
justify-content: space-between;
|
|
|
|
`
|
2018-10-27 10:54:52 +03:00
|
|
|
|
2019-05-30 23:42:25 +03:00
|
|
|
const BodyWrapper = styled.div`
|
2019-08-07 21:58:29 +03:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2019-05-30 23:42:25 +03:00
|
|
|
width: 100%;
|
2020-05-06 03:40:59 +03:00
|
|
|
padding-top: 160px;
|
2019-08-07 21:58:29 +03:00
|
|
|
align-items: center;
|
|
|
|
flex: 1;
|
2020-05-20 22:00:33 +03:00
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
2020-05-06 03:40:59 +03:00
|
|
|
z-index: 10;
|
2020-05-01 04:14:29 +03:00
|
|
|
|
2020-05-06 22:34:06 +03:00
|
|
|
${({ theme }) => theme.mediaWidth.upToExtraSmall`
|
2020-05-16 17:44:26 +03:00
|
|
|
padding: 16px;
|
2020-05-06 22:34:06 +03:00
|
|
|
`};
|
|
|
|
|
2020-05-01 04:14:29 +03:00
|
|
|
z-index: 1;
|
2019-05-30 23:42:25 +03:00
|
|
|
`
|
2019-04-25 19:12:47 +03:00
|
|
|
|
2020-05-27 18:42:25 +03:00
|
|
|
const Marginer = styled.div`
|
|
|
|
margin-top: 5rem;
|
|
|
|
`
|
|
|
|
|
2019-05-30 23:42:25 +03:00
|
|
|
export default function App() {
|
|
|
|
return (
|
2020-05-20 22:00:33 +03:00
|
|
|
<Suspense fallback={null}>
|
2020-06-30 20:41:51 +03:00
|
|
|
<HashRouter>
|
2020-05-20 22:00:33 +03:00
|
|
|
<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} />
|
2020-07-09 06:06:29 +03:00
|
|
|
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
|
2020-05-20 22:00:33 +03:00
|
|
|
<Route exact strict path="/find" component={PoolFinder} />
|
|
|
|
<Route exact strict path="/pool" component={Pool} />
|
2020-07-10 22:25:15 +03:00
|
|
|
<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} />
|
2020-07-27 20:33:02 +03:00
|
|
|
<Route exact strict path="/remove/v1/:address" component={RemoveV1Exchange} />
|
2020-07-20 14:48:42 +03:00
|
|
|
<Route exact strict path="/remove/:tokens" component={RedirectOldRemoveLiquidityPathStructure} />
|
|
|
|
<Route exact strict path="/remove/:currencyIdA/:currencyIdB" component={RemoveLiquidity} />
|
2020-06-03 21:07:01 +03:00
|
|
|
<Route exact strict path="/migrate/v1" component={MigrateV1} />
|
|
|
|
<Route exact strict path="/migrate/v1/:address" component={MigrateV1Exchange} />
|
2020-05-20 22:00:33 +03:00
|
|
|
<Route component={RedirectPathToSwapOnly} />
|
|
|
|
</Switch>
|
|
|
|
</Web3ReactManager>
|
2020-05-27 18:42:25 +03:00
|
|
|
<Marginer />
|
2020-05-20 22:00:33 +03:00
|
|
|
</BodyWrapper>
|
|
|
|
</AppWrapper>
|
2020-06-30 20:41:51 +03:00
|
|
|
</HashRouter>
|
2020-05-20 22:00:33 +03:00
|
|
|
</Suspense>
|
2019-05-30 23:42:25 +03:00
|
|
|
)
|
2018-10-07 00:24:17 +03:00
|
|
|
}
|