forked from pancakeswap/pancake-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
42 lines (39 loc) · 1.13 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { useMemo, ReactNode } from 'react'
import ReactDOM from 'react-dom'
import useActiveWeb3React from './hooks/useActiveWeb3React'
import { BLOCKED_ADDRESSES } from './config/constants'
import ApplicationUpdater from './state/application/updater'
import ListsUpdater from './state/lists/updater'
import MulticallUpdater from './state/multicall/updater'
import TransactionUpdater from './state/transactions/updater'
import App from './App'
import Providers from './Providers'
function Updaters() {
return (
<>
<ListsUpdater />
<ApplicationUpdater />
<TransactionUpdater />
<MulticallUpdater />
</>
)
}
function Blocklist({ children }: { children: ReactNode }) {
const { account } = useActiveWeb3React()
const blocked: boolean = useMemo(() => Boolean(account && BLOCKED_ADDRESSES.indexOf(account) !== -1), [account])
if (blocked) {
return <div>Blocked address</div>
}
return <>{children}</>
}
ReactDOM.render(
<React.StrictMode>
<Blocklist>
<Providers>
<Updaters />
<App />
</Providers>
</Blocklist>
</React.StrictMode>,
document.getElementById('root'),
)