Skip to content

Commit 8b3ea52

Browse files
authored
feat: add updated sidebar icons (#407)
1 parent ac50054 commit 8b3ea52

3 files changed

Lines changed: 41 additions & 35 deletions

File tree

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"react-router": "6.2.1",
5959
"react-router-dom": "6.2.1",
6060
"react-syntax-highlighter": "15.4.4",
61+
"remixicon-react": "^1.0.0",
6162
"semver": "7.3.5",
6263
"serve-handler": "6.1.3",
6364
"stream": "npm:stream-browserify",

src/components/SideBar.tsx

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,44 @@
1-
import { BeeModes } from '@ethersphere/bee-js'
21
import { Divider, Drawer, Grid, Link as MUILink, List } from '@material-ui/core'
32
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'
4-
import { OpenInNewSharp } from '@material-ui/icons'
5-
import { ReactElement, useContext } from 'react'
6-
import { BookOpen, Briefcase, DollarSign, FileText, Home, Settings } from 'react-feather'
3+
import { ReactElement } from 'react'
74
import { Link } from 'react-router-dom'
5+
import FilesIcon from 'remixicon-react/ArrowUpDownLineIcon'
6+
import DocsIcon from 'remixicon-react/BookOpenLineIcon'
7+
import ExternalLinkIcon from 'remixicon-react/ExternalLinkLineIcon'
8+
import HomeIcon from 'remixicon-react/Home3LineIcon'
9+
import SettingsIcon from 'remixicon-react/Settings2LineIcon'
10+
import AccountIcon from 'remixicon-react/Wallet3LineIcon'
811
import DashboardLogo from '../assets/dashboard-logo.svg'
912
import DesktopLogo from '../assets/desktop-logo.svg'
1013
import { config } from '../config'
1114
import { useIsBeeDesktop } from '../hooks/apiHooks'
12-
import { Context } from '../providers/Bee'
1315
import { ROUTES } from '../routes'
16+
import Feedback from './Feedback'
1417
import SideBarItem from './SideBarItem'
1518
import SideBarStatus from './SideBarStatus'
16-
import Feedback from './Feedback'
1719

1820
const navBarItems = [
1921
{
2022
label: 'Info',
2123
path: ROUTES.INFO,
22-
icon: Home,
24+
icon: HomeIcon,
2325
},
2426
{
2527
label: 'Files',
2628
path: ROUTES.UPLOAD,
27-
icon: FileText,
29+
icon: FilesIcon,
2830
pathMatcherSubstring: '/files/',
2931
},
3032
{
3133
label: 'Account',
3234
path: ROUTES.ACCOUNT_WALLET,
33-
icon: Briefcase,
35+
icon: AccountIcon,
3436
pathMatcherSubstring: '/account/',
3537
},
36-
{
37-
label: 'Top Up',
38-
path: ROUTES.WALLET,
39-
icon: DollarSign,
40-
requiresMode: BeeModes.ULTRA_LIGHT,
41-
},
4238
{
4339
label: 'Settings',
4440
path: ROUTES.SETTINGS,
45-
icon: Settings,
41+
icon: SettingsIcon,
4642
},
4743
]
4844

@@ -72,9 +68,6 @@ const useStyles = makeStyles((theme: Theme) =>
7268
icon: {
7369
height: theme.spacing(4),
7470
},
75-
iconSmall: {
76-
height: theme.spacing(2),
77-
},
7871
divider: {
7972
backgroundColor: '#2c2c2c',
8073
marginLeft: theme.spacing(4),
@@ -97,7 +90,6 @@ const useStyles = makeStyles((theme: Theme) =>
9790

9891
export default function SideBar(): ReactElement {
9992
const classes = useStyles()
100-
const { nodeInfo } = useContext(Context)
10193
const { isBeeDesktop } = useIsBeeDesktop()
10294

10395
return (
@@ -110,26 +102,24 @@ export default function SideBar(): ReactElement {
110102
</Grid>
111103
<Grid>
112104
<List>
113-
{navBarItems
114-
.filter(p => !p.requiresMode || nodeInfo?.beeMode === p.requiresMode)
115-
.map(p => (
116-
<Link to={p.path} key={p.path} className={classes.link}>
117-
<SideBarItem
118-
key={p.path}
119-
iconStart={<p.icon className={classes.icon} />}
120-
path={p.path}
121-
pathMatcherSubstring={p.pathMatcherSubstring}
122-
label={p.label}
123-
/>
124-
</Link>
125-
))}
105+
{navBarItems.map(p => (
106+
<Link to={p.path} key={p.path} className={classes.link}>
107+
<SideBarItem
108+
key={p.path}
109+
iconStart={<p.icon className={classes.icon} />}
110+
path={p.path}
111+
pathMatcherSubstring={p.pathMatcherSubstring}
112+
label={p.label}
113+
/>
114+
</Link>
115+
))}
126116
</List>
127117
<Divider className={classes.divider} />
128118
<List>
129119
<MUILink href={config.BEE_DOCS_HOST} target="_blank" className={classes.link}>
130120
<SideBarItem
131-
iconStart={<BookOpen className={classes.icon} />}
132-
iconEnd={<OpenInNewSharp className={classes.iconSmall} />}
121+
iconStart={<DocsIcon className={classes.icon} />}
122+
iconEnd={<ExternalLinkIcon className={classes.icon} color="#595959" />}
133123
label={<span>Docs</span>}
134124
/>
135125
</MUILink>

0 commit comments

Comments
 (0)