Add network info

This commit is contained in:
Mati Dastugue 2021-06-01 10:56:47 -03:00
parent 9a03fa6702
commit 02901c40e2
2 changed files with 20 additions and 13 deletions

View File

@ -19,7 +19,8 @@ import { headerHeight, md, screenSm, sm } from 'src/theme/variables'
import { useStateHandler } from 'src/logic/hooks/useStateHandler'
import SafeLogo from '../assets/gnosis-safe-multisig-logo.svg'
import { NETWORKSNAMES } from 'src/utils/constants'
import { NETWORK_NAMES } from 'src/utils/constants'
import { getNetworkInfo } from 'src/config'
const styles = () => ({
root: {
@ -69,16 +70,8 @@ const styles = () => ({
const Layout = ({ classes, providerDetails, providerInfo }) => {
const { clickAway, open, toggle } = useStateHandler()
const { clickAway: clickAwayNetworks, open: openNetworks, toggle: toggleNetworks } = useStateHandler()
const networkList = NETWORKSNAMES.map((network) => {
return (
<>
<NetworkLabel networkName={network} />
<Divider />
</>
)
})
const networkInfo = getNetworkInfo()
console.log(networkInfo)
return (
<Row className={classes.summary}>
<Col className={classes.logo} middle="xs" start="xs">
@ -129,7 +122,12 @@ const Layout = ({ classes, providerDetails, providerInfo }) => {
<>
<ClickAwayListener mouseEvent="onClick" onClickAway={clickAwayNetworks} touchEvent={false}>
<List className={classes.network} component="div">
{networkList}
{NETWORK_NAMES.map((network) => (
<React.Fragment key={network.name}>
<NetworkLabel networkName={network.name} />
<Divider />
</React.Fragment>
))}
</List>
</ClickAwayListener>
</>

View File

@ -34,4 +34,13 @@ export const SPENDING_LIMIT_MODULE_ADDRESS =
export const KNOWN_MODULES = {
[SPENDING_LIMIT_MODULE_ADDRESS]: 'Spending limit',
}
export const NETWORKSNAMES = ['Ethereum', 'xDai', 'Polygon', 'BSC', 'Arbitrium', 'EWC', 'Rinkeby', 'Volta']
export const NETWORK_NAMES = [
{ name: 'Ethereum', url: 'https://gnosis-safe.io/app' },
{ name: 'xDai', url: 'https://xdai.gnosis-safe.io/app' },
{ name: 'Polygon', url: 'https://polygon.gnosis-safe.io/app' },
{ name: 'BSC', url: 'https://bsc.gnosis-safe.io/app' },
{ name: 'Arbitrium', url: 'https://arbitrum.gnosis-safe.io/app' },
{ name: 'EWC', url: 'https://ewc.gnosis-safe.io/app' },
{ name: 'Rinkeby', url: 'https://rinkeby.gnosis-safe.io/app' },
{ name: 'Volta', url: 'https://volta.gnosis-safe.io/app' },
]