mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 15:42:39 +00:00
remove unneeded handler
This commit is contained in:
@@ -4,7 +4,6 @@ const { useState, useEffect } = React;
|
|||||||
|
|
||||||
const maxZoom = 300;
|
const maxZoom = 300;
|
||||||
const minZoom = 10;
|
const minZoom = 10;
|
||||||
const zoomStep = 10;
|
|
||||||
|
|
||||||
const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
@@ -42,22 +41,6 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleInputChange = (value, type)=>{
|
|
||||||
const newValue = parseInt(value, 10);
|
|
||||||
|
|
||||||
if(type === 'zoom' && newValue >= minZoom && newValue <= maxZoom) {
|
|
||||||
setState((prevState)=>({
|
|
||||||
...prevState,
|
|
||||||
zoomInput : newValue,
|
|
||||||
}));
|
|
||||||
} else if(type === 'page' && newValue >= 1 && newValue <= totalPages) {
|
|
||||||
setState((prevState)=>({
|
|
||||||
...prevState,
|
|
||||||
pageNumberInput : newValue,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='toolBar'>
|
<div className='toolBar'>
|
||||||
<div className='tool'>
|
<div className='tool'>
|
||||||
@@ -76,9 +59,8 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
list='zoomLevels'
|
list='zoomLevels'
|
||||||
min={minZoom}
|
min={minZoom}
|
||||||
max={maxZoom}
|
max={maxZoom}
|
||||||
step={zoomStep}
|
step='1'
|
||||||
value={state.zoomInput}
|
value={state.zoomInput}
|
||||||
// onChange={(e)=>handleInputChange(e.target.value, 'zoom')}
|
|
||||||
onChange={(e)=>{
|
onChange={(e)=>{
|
||||||
const newZoomLevel = parseInt(e.target.value, 10);
|
const newZoomLevel = parseInt(e.target.value, 10);
|
||||||
if(newZoomLevel !== state.zoomLevel) {
|
if(newZoomLevel !== state.zoomLevel) {
|
||||||
|
|||||||
Reference in New Issue
Block a user