Skip to content

Commit d9ae0f5

Browse files
rjwatskasedy
andauthored
Header logo (#133)
* Display project icon in the top of application menu bar Co-authored-by: kasedy <[email protected]>
1 parent 1e05546 commit d9ae0f5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

interface/src/components/MenuAppBar.tsx

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { RefObject } from 'react';
22
import { Link, withRouter, RouteComponentProps } from 'react-router-dom';
33

4-
import { Drawer, AppBar, Toolbar, Avatar, Divider, Button, IconButton } from '@material-ui/core';
4+
import { Drawer, AppBar, Toolbar, Avatar, Divider, Button, Box, IconButton } from '@material-ui/core';
55
import { ClickAwayListener, Popper, Hidden, Typography } from '@material-ui/core';
66
import { List, ListItem, ListItemIcon, ListItemText, ListItemAvatar } from '@material-ui/core';
77
import { Card, CardContent, CardActions } from '@material-ui/core';
@@ -42,6 +42,16 @@ const styles = (theme: Theme) => createStyles({
4242
width: `calc(100% - ${drawerWidth}px)`,
4343
},
4444
},
45+
toolbarImage: {
46+
[theme.breakpoints.up('xs')]: {
47+
height: 24,
48+
marginRight: theme.spacing(2)
49+
},
50+
[theme.breakpoints.up('sm')]: {
51+
height: 36,
52+
marginRight: theme.spacing(3)
53+
},
54+
},
4555
menuButton: {
4656
marginRight: theme.spacing(2),
4757
[theme.breakpoints.up('md')]: {
@@ -64,7 +74,7 @@ const styles = (theme: Theme) => createStyles({
6474
"& > * + *": {
6575
marginLeft: theme.spacing(2),
6676
}
67-
}
77+
},
6878
});
6979

7080
interface MenuAppBarState {
@@ -110,6 +120,9 @@ class MenuAppBar extends React.Component<MenuAppBarProps, MenuAppBarState> {
110120
const drawer = (
111121
<div>
112122
<Toolbar>
123+
<Box display="flex">
124+
<img src="/app/icon.png" className={classes.toolbarImage} alt={PROJECT_NAME} />
125+
</Box>
113126
<Typography variant="h6" color="textPrimary">
114127
{PROJECT_NAME}
115128
</Typography>
@@ -142,7 +155,7 @@ class MenuAppBar extends React.Component<MenuAppBarProps, MenuAppBarState> {
142155
<DeviceHubIcon />
143156
</ListItemIcon>
144157
<ListItemText primary="MQTT" />
145-
</ListItem>
158+
</ListItem>
146159
<ListItem to='/security/' selected={path.startsWith('/security/')} button component={Link} disabled={!authenticatedContext.me.admin}>
147160
<ListItemIcon>
148161
<LockIcon />

0 commit comments

Comments
 (0)