mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 01:12:44 +00:00
functional zoom
This commit is contained in:
@@ -3,13 +3,18 @@ const React = require('react');
|
||||
const { useState, useRef, useEffect } = React;
|
||||
const _ = require('lodash');
|
||||
|
||||
const ToolBar = () => {
|
||||
const ToolBar = ({updateZoom}) => {
|
||||
const [state, setState] = useState({
|
||||
currentPage: 1,
|
||||
totalPages: 10,
|
||||
zoomLevel: 100,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
console.log(`Zoom to: ${state.zoomLevel}`);
|
||||
updateZoom(state.zoomLevel);
|
||||
}, [state.zoomLevel]);
|
||||
|
||||
const setZoomLevel = (direction) => {
|
||||
let zoomLevel = state.zoomLevel;
|
||||
if (direction === 'in') {
|
||||
|
||||
Reference in New Issue
Block a user