0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 01:12:44 +00:00

functional zoom

This commit is contained in:
Víctor Losada Hernández
2024-05-28 08:51:23 +02:00
parent bc9ab284d8
commit 4543881808
2 changed files with 33 additions and 2 deletions

View File

@@ -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') {