2021-03-30 15:47:08 -07:00
|
|
|
import Head from 'next/head'
|
2021-04-11 14:25:01 -07:00
|
|
|
import { ThemeProvider } from 'next-themes'
|
2021-04-02 11:26:21 -07:00
|
|
|
import '../node_modules/react-grid-layout/css/styles.css'
|
|
|
|
import '../node_modules/react-resizable/css/styles.css'
|
|
|
|
import '../styles/index.css'
|
2021-04-15 14:54:42 -07:00
|
|
|
import useWallet from '../hooks/useWallet'
|
|
|
|
import useHydrateStore from '../hooks/useHydrateStore'
|
2021-04-24 19:10:28 -07:00
|
|
|
import Notifications from '../components/Notification'
|
2021-09-25 03:17:35 -07:00
|
|
|
import useMangoStore from '../stores/useMangoStore'
|
|
|
|
import useOraclePrice from '../hooks/useOraclePrice'
|
|
|
|
import { formatUsdValue } from '../utils'
|
|
|
|
import { useRouter } from 'next/router'
|
2021-09-03 05:11:21 -07:00
|
|
|
import { ViewportProvider } from '../hooks/useViewport'
|
2021-09-19 17:36:02 -07:00
|
|
|
import BottomBar from '../components/mobile/BottomBar'
|
2021-03-30 15:47:08 -07:00
|
|
|
|
|
|
|
function App({ Component, pageProps }) {
|
2021-04-15 14:54:42 -07:00
|
|
|
useHydrateStore()
|
|
|
|
useWallet()
|
2021-09-25 03:17:35 -07:00
|
|
|
const marketConfig = useMangoStore((s) => s.selectedMarket.config)
|
|
|
|
const oraclePrice = useOraclePrice()
|
|
|
|
const router = useRouter()
|
|
|
|
const selectedMarketName = marketConfig.name
|
|
|
|
const marketTitleString =
|
|
|
|
marketConfig && router.pathname.includes('[market]')
|
|
|
|
? `${
|
|
|
|
oraclePrice ? formatUsdValue(oraclePrice) + ' | ' : ''
|
|
|
|
}${selectedMarketName} - `
|
|
|
|
: ''
|
2021-04-15 14:54:42 -07:00
|
|
|
|
2021-03-30 15:47:08 -07:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Head>
|
2021-09-25 03:17:35 -07:00
|
|
|
<title>{marketTitleString}Mango Markets</title>
|
2021-03-30 15:47:08 -07:00
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
|
|
<link
|
2021-04-16 04:50:56 -07:00
|
|
|
href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap"
|
2021-03-30 15:47:08 -07:00
|
|
|
rel="stylesheet"
|
|
|
|
/>
|
2021-04-13 13:34:06 -07:00
|
|
|
<link rel="icon" href="/favicon.ico" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<meta
|
|
|
|
name="keywords"
|
|
|
|
content="Mango Markets, Serum, SRM, Serum DEX, DEFI, Decentralized Finance, Decentralised Finance, Crypto, ERC20, Ethereum, Decentralize, Solana, SOL, SPL, Cross-Chain, Trading, Fastest, Fast, SerumBTC, SerumUSD, SRM Tokens, SPL Tokens"
|
|
|
|
/>
|
|
|
|
<meta
|
|
|
|
name="description"
|
2021-08-29 21:56:27 -07:00
|
|
|
content="Mango Markets - Decentralised, cross-margin trading up to 10x leverage with lightning speed and near-zero fees."
|
2021-04-13 13:34:06 -07:00
|
|
|
/>
|
|
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
2021-10-11 13:47:38 -07:00
|
|
|
<meta property="og:title" content="Mango Markets" />
|
2021-04-13 13:34:06 -07:00
|
|
|
<meta name="msapplication-TileColor" content="#da532c" />
|
|
|
|
<meta name="theme-color" content="#ffffff" />
|
|
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
|
|
<meta name="twitter:title" content="Mango Markets" />
|
|
|
|
<meta
|
|
|
|
name="twitter:description"
|
2021-08-29 21:56:27 -07:00
|
|
|
content="Mango Markets - Decentralised, cross-margin trading up to 10x leverage with lightning speed and near-zero fees."
|
2021-04-13 13:34:06 -07:00
|
|
|
/>
|
|
|
|
<meta name="twitter:image" content="/twitter-image.png" />
|
2021-03-30 15:47:08 -07:00
|
|
|
|
|
|
|
<script src="/datafeeds/udf/dist/polyfills.js"></script>
|
|
|
|
<script src="/datafeeds/udf/dist/bundle.js"></script>
|
2021-04-13 13:45:07 -07:00
|
|
|
|
|
|
|
<link rel="manifest" href="/manifest.json"></link>
|
2021-03-30 15:47:08 -07:00
|
|
|
</Head>
|
2021-04-13 13:23:28 -07:00
|
|
|
<ThemeProvider defaultTheme="Mango">
|
2021-09-03 05:11:21 -07:00
|
|
|
<ViewportProvider>
|
|
|
|
<div className="bg-th-bkg-1">
|
|
|
|
<Component {...pageProps} />
|
|
|
|
</div>
|
2021-09-19 17:36:02 -07:00
|
|
|
<div className="md:hidden fixed bottom-0 left-0 w-full z-20">
|
|
|
|
<BottomBar />
|
|
|
|
</div>
|
2021-09-03 05:11:21 -07:00
|
|
|
<Notifications />
|
|
|
|
</ViewportProvider>
|
2021-04-11 14:25:01 -07:00
|
|
|
</ThemeProvider>
|
2021-03-30 15:47:08 -07:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App
|