feat: add show navbar on hover setting back

This commit is contained in:
David Ralph
2021-09-30 19:35:02 +01:00
parent a5dc2c98a0
commit 33ef113f6d
3 changed files with 27 additions and 2 deletions

View File

@@ -54,8 +54,8 @@ export default class Navbar extends PureComponent {
render() {
const backgroundEnabled = (localStorage.getItem('background') === 'true');
return (
const navbar = (
<div className='navbar-container' ref={this.navbarContainer}>
{(localStorage.getItem('view') === 'true' && backgroundEnabled) ? <Maximise/> : null}
{(localStorage.getItem('favouriteEnabled') === 'true' && backgroundEnabled) ? <Favourite/> : null}
@@ -84,5 +84,11 @@ export default class Navbar extends PureComponent {
</Tooltip>
</div>
);
if (localStorage.getItem('navbarHover') === 'true') {
return <div className='navbar-hover'>{navbar}</div>;
} else {
return navbar;
}
}
}

View File

@@ -32,3 +32,21 @@
}
}
}
.navbar-hover {
position: absolute;
top: 0rem;
right: 0rem;
height: 50px;
width: 500px;
.navbar-container {
visibility: hidden;
}
&:hover {
.navbar-container {
visibility: visible;
}
}
}