Skip to content

Commit

Permalink
feat: ultra-light mode block not supported features that are not avai…
Browse files Browse the repository at this point in the history
…lable in this mode (#438)
  • Loading branch information
vojtechsimetka committed Jun 24, 2022
1 parent 2e0eeb7 commit 83aab3b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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

Expand Down Expand Up @@ -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 = [
{
Expand All @@ -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/',
},
Expand Down
5 changes: 3 additions & 2 deletions src/pages/account/wallet/AccountWallet.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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()

Expand All @@ -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>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/files/Download.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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'
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'
Expand All @@ -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()
Expand Down Expand Up @@ -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)}
Expand Down

0 comments on commit 83aab3b

Please sign in to comment.