refactor: remove env. variables from the component (#529)

This commit is contained in:
Adam Uhlíř
2022-09-07 23:51:55 -07:00
committed by GitHub
parent 0603018f09
commit 0c262a4811
23 changed files with 186 additions and 207 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
import { Typography } from '@material-ui/core/'
import { ReactElement } from 'react'
import Identicon from 'react-identicons'
import { config } from '../config'
import ClipboardCopy from './ClipboardCopy'
import QRCodeModal from './QRCodeModal'
import { BLOCKCHAIN_EXPLORER_URL } from '../constants'
interface Props {
address: string | undefined
@@ -36,7 +36,7 @@ export default function EthereumAddress(props: Props): ReactElement {
}
: { marginRight: '7px' }
}
href={`${config.BLOCKCHAIN_EXPLORER_URL}/${props.transaction ? 'tx' : 'address'}/${props.address}`}
href={`${BLOCKCHAIN_EXPLORER_URL}/${props.transaction ? 'tx' : 'address'}/${props.address}`}
target="_blank"
rel="noreferrer"
>
+4 -4
View File
@@ -12,11 +12,11 @@ import { Context as BeeContext } from '../providers/Bee'
import { Context as SettingsContext } from '../providers/Settings'
import DashboardLogo from '../assets/dashboard-logo.svg'
import DesktopLogo from '../assets/desktop-logo.svg'
import { config } from '../config'
import { ROUTES } from '../routes'
import SideBarItem from './SideBarItem'
import SideBarStatus from './SideBarStatus'
import { BeeModes } from '@ethersphere/bee-js'
import { BEE_DOCS_HOST } from '../constants'
const drawerWidth = 300
@@ -66,7 +66,7 @@ const useStyles = makeStyles((theme: Theme) =>
export default function SideBar(): ReactElement {
const classes = useStyles()
const { isBeeDesktop } = useContext(SettingsContext)
const { isDesktop } = useContext(SettingsContext)
const { nodeInfo } = useContext(BeeContext)
const navBarItems = [
@@ -99,7 +99,7 @@ export default function SideBar(): ReactElement {
<Grid container direction="column" justifyContent="space-between" className={classes.root}>
<Grid className={classes.logo}>
<Link to={ROUTES.INFO}>
<img alt="swarm" src={isBeeDesktop ? DesktopLogo : DashboardLogo} />
<img alt="swarm" src={isDesktop ? DesktopLogo : DashboardLogo} />
</Link>
</Grid>
<Grid>
@@ -118,7 +118,7 @@ export default function SideBar(): ReactElement {
</List>
<Divider className={classes.divider} />
<List>
<MUILink href={config.BEE_DOCS_HOST} target="_blank" className={classes.link}>
<MUILink href={BEE_DOCS_HOST} target="_blank" className={classes.link}>
<SideBarItem
iconStart={<DocsIcon className={classes.icon} />}
iconEnd={<ExternalLinkIcon className={classes.icon} color="#595959" />}
@@ -3,8 +3,8 @@ import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'
import type { ReactElement } from 'react'
import Activity from 'remixicon-react/PulseLineIcon'
import { Link } from 'react-router-dom'
import { config } from '../config'
import { ROUTES } from '../routes'
import { BEE_DISCORD_HOST, BEE_DOCS_HOST } from '../constants'
const useStyles = makeStyles((theme: Theme) =>
createStyles({
@@ -37,11 +37,11 @@ export default function TroubleshootConnectionCard(): ReactElement {
<Grid item className={classes.content}>
<Typography align="center">
Please check your node status to fix the problem. You can also check out the{' '}
<MuiLink href={config.BEE_DOCS_HOST} target="_blank" rel="noreferrer">
<MuiLink href={BEE_DOCS_HOST} target="_blank" rel="noreferrer">
Swarm Bee Docs
</MuiLink>{' '}
or ask for support on the{' '}
<MuiLink href={config.BEE_DISCORD_HOST} target="_blank" rel="noreferrer">
<MuiLink href={BEE_DISCORD_HOST} target="_blank" rel="noreferrer">
Ethereum Swarm Discord
</MuiLink>
.