1
1
import React , { useContext } from 'react' ;
2
2
import { makeStyles } from '@material-ui/core/styles' ;
3
- import { AppBar , IconButton , Toolbar , Typography } from '@material-ui/core' ;
3
+ import { AppBar , IconButton , Toolbar , Tooltip , Typography } from '@material-ui/core' ;
4
4
import { APP_NAME } from '../../settings'
5
5
import { AccountCircle } from '@material-ui/icons' ;
6
6
import MenuItem from '@material-ui/core/MenuItem' ;
@@ -24,16 +24,18 @@ const useStyles = makeStyles((theme) => ({
24
24
export default function TopBar ( props : AppProps ) {
25
25
const classes = useStyles ( ) ;
26
26
const { darkMode, setDarkMode } = useContext ( ThemeContext ) ;
27
-
27
+
28
28
return (
29
29
< AppBar position = "relative" >
30
30
< Toolbar className = { props . isAuthenticated ? classes . authToolbar : undefined } >
31
31
< Typography variant = "h5" align = "center" className = { classes . title } >
32
32
{ APP_NAME }
33
33
</ Typography >
34
- < IconButton color = "inherit" onClick = { ( ) => setDarkMode ( ! darkMode ) } >
35
- { darkMode ? < Brightness4Icon /> : < Brightness7Icon /> }
36
- </ IconButton >
34
+ < Tooltip title = { `Toggle light/dark theme` } >
35
+ < IconButton color = "inherit" onClick = { ( ) => setDarkMode ( ! darkMode ) } >
36
+ { darkMode ? < Brightness7Icon /> : < Brightness4Icon /> }
37
+ </ IconButton >
38
+ </ Tooltip >
37
39
{ props . isAuthenticated && (
38
40
< DropdownMenu dropdownButtonIcon = { < AccountCircle /> } >
39
41
< div >
0 commit comments