parent
52b09bba59
commit
8d4cfcc8bb
4 changed files with 66 additions and 1 deletions
@ -0,0 +1,26 @@ |
||||
.toolbar { |
||||
-webkit-app-region: drag; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
padding: 0.5rem; |
||||
background: color(mainBackground); |
||||
border-bottom: solid 1px color(background); |
||||
|
||||
button { |
||||
-webkit-app-region: none; |
||||
padding: 0.5rem !important; |
||||
margin: 0; |
||||
font-size: 0.8rem; |
||||
background-color: color(sidebarBackground); |
||||
aspect-ratio: 1; |
||||
|
||||
&:not(:last-child) { |
||||
margin-right: 0.5rem; |
||||
} |
||||
|
||||
svg { |
||||
margin: 0; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
import React, {useContext} from "react"; |
||||
|
||||
import {Folder2Open, Cast} from "react-bootstrap-icons"; |
||||
|
||||
import SlideContext from "../shared/SlideContext"; |
||||
import Mode from "../models/Mode"; |
||||
|
||||
const Toolbar = ({openFile}) => { |
||||
const {setMode, setSlide} = useContext(SlideContext); |
||||
|
||||
const present = () => { |
||||
setMode(Mode.PRESENT); |
||||
setSlide(0); |
||||
document.documentElement.requestFullscreen(); |
||||
} |
||||
|
||||
return ( |
||||
<nav className="toolbar"> |
||||
<button onClick={openFile} title="Open file"><Folder2Open /></button> |
||||
<button onClick={present} title="Start presentation [F5]"><Cast /></button> |
||||
</nav> |
||||
); |
||||
}; |
||||
|
||||
export default Toolbar; |
Loading…
Reference in new issue