import React from 'react'; import ToolbarComponent from '../components/Toolbar'; import useActions from '../actions'; import useStore from '../store'; import { scrollIntoView } from '../helpers/utility'; const Toolbar = () => { const [{totalPage, currentPage, scale, rotation, viewport}, dispatch] = useStore(); const { setCurrentPage, changeScale, changeRotate } = useActions(dispatch); const _setCurrentPage = (num: number) => { if (num > 0) { const ele: HTMLElement = document.getElementById(`page_${num}`)!; scrollIntoView(ele); } setCurrentPage(num); } return ( ); }; export default Toolbar;