feat: ultra-light mode block not supported features that are not available in this mode (#438)
This commit is contained in:
@@ -8,6 +8,7 @@ import ExternalLinkIcon from 'remixicon-react/ExternalLinkLineIcon'
|
||||
import HomeIcon from 'remixicon-react/Home3LineIcon'
|
||||
import SettingsIcon from 'remixicon-react/Settings2LineIcon'
|
||||
import AccountIcon from 'remixicon-react/Wallet3LineIcon'
|
||||
import { Context as BeeContext } from '../providers/Bee'
|
||||
import { Context as TopUpContext } from '../providers/TopUp'
|
||||
import DashboardLogo from '../assets/dashboard-logo.svg'
|
||||
import DesktopLogo from '../assets/desktop-logo.svg'
|
||||
@@ -17,6 +18,7 @@ import { ROUTES } from '../routes'
|
||||
import Feedback from './Feedback'
|
||||
import SideBarItem from './SideBarItem'
|
||||
import SideBarStatus from './SideBarStatus'
|
||||
import { BeeModes } from '@ethersphere/bee-js'
|
||||
|
||||
const drawerWidth = 300
|
||||
|
||||
@@ -68,6 +70,7 @@ export default function SideBar(): ReactElement {
|
||||
const classes = useStyles()
|
||||
const { isBeeDesktop } = useIsBeeDesktop()
|
||||
const { providerUrl } = useContext(TopUpContext)
|
||||
const { nodeInfo } = useContext(BeeContext)
|
||||
|
||||
const navBarItems = [
|
||||
{
|
||||
@@ -77,7 +80,7 @@ export default function SideBar(): ReactElement {
|
||||
},
|
||||
{
|
||||
label: 'Files',
|
||||
path: ROUTES.UPLOAD,
|
||||
path: nodeInfo?.beeMode === BeeModes.ULTRA_LIGHT ? ROUTES.DOWNLOAD : ROUTES.UPLOAD,
|
||||
icon: FilesIcon,
|
||||
pathMatcherSubstring: '/files/',
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { BeeModes } from '@ethersphere/bee-js'
|
||||
import { Box, Grid, Typography } from '@material-ui/core'
|
||||
import { ReactElement, useContext } from 'react'
|
||||
import { useNavigate } from 'react-router'
|
||||
@@ -15,7 +16,7 @@ import { AccountNavigation } from '../AccountNavigation'
|
||||
import { Header } from '../Header'
|
||||
|
||||
export function AccountWallet(): ReactElement {
|
||||
const { balance, nodeAddresses } = useContext(Context)
|
||||
const { balance, nodeAddresses, nodeInfo } = useContext(Context)
|
||||
|
||||
const navigate = useNavigate()
|
||||
|
||||
@@ -34,7 +35,7 @@ export function AccountWallet(): ReactElement {
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
<AccountNavigation active="WALLET" />
|
||||
{nodeInfo?.beeMode !== BeeModes.ULTRA_LIGHT && <AccountNavigation active="WALLET" />}
|
||||
<Box mb={4}>
|
||||
<Grid container direction="row" justifyContent="space-between" alignItems="center">
|
||||
<Typography variant="h2">Wallet balance</Typography>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Utils } from '@ethersphere/bee-js'
|
||||
import { BeeModes, Utils } from '@ethersphere/bee-js'
|
||||
import { ManifestJs } from '@ethersphere/manifest-js'
|
||||
import { useSnackbar } from 'notistack'
|
||||
import { ReactElement, useContext, useState } from 'react'
|
||||
@@ -6,8 +6,9 @@ import { useNavigate } from 'react-router-dom'
|
||||
import Search from 'remixicon-react/SearchLineIcon'
|
||||
import ExpandableListItemInput from '../../components/ExpandableListItemInput'
|
||||
import { History } from '../../components/History'
|
||||
import { Context, defaultUploadOrigin } from '../../providers/File'
|
||||
import { Context as FileContext, defaultUploadOrigin } from '../../providers/File'
|
||||
import { Context as SettingsContext } from '../../providers/Settings'
|
||||
import { Context as BeeContext } from '../../providers/Bee'
|
||||
import { ROUTES } from '../../routes'
|
||||
import { recognizeEnsOrSwarmHash, regexpEns } from '../../utils'
|
||||
import { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'
|
||||
@@ -17,8 +18,9 @@ export function Download(): ReactElement {
|
||||
const [loading, setLoading] = useState(false)
|
||||
const { beeApi } = useContext(SettingsContext)
|
||||
const [referenceError, setReferenceError] = useState<string | undefined>(undefined)
|
||||
const { nodeInfo } = useContext(BeeContext)
|
||||
|
||||
const { setUploadOrigin } = useContext(Context)
|
||||
const { setUploadOrigin } = useContext(FileContext)
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar()
|
||||
const navigate = useNavigate()
|
||||
@@ -81,7 +83,7 @@ export function Download(): ReactElement {
|
||||
|
||||
return (
|
||||
<>
|
||||
<FileNavigation active="DOWNLOAD" />
|
||||
{nodeInfo?.beeMode !== BeeModes.ULTRA_LIGHT && <FileNavigation active="DOWNLOAD" />}
|
||||
<ExpandableListItemInput
|
||||
label="Swarm Hash"
|
||||
onConfirm={value => onSwarmIdentifier(value)}
|
||||
|
||||
Reference in New Issue
Block a user