diff --git a/src/components/Setting/FontSize/fontsize.js b/src/components/Setting/FontSize/fontsize.js index b953c64..6386c9d 100644 --- a/src/components/Setting/FontSize/fontsize.js +++ b/src/components/Setting/FontSize/fontsize.js @@ -34,11 +34,21 @@ function Display(props) { const Fontsize = (props) => { const { bookStyle, setBookStyle } = props; // const [countersize, setCounter ] = useState(1) - const incrementCounter = () => - setBookStyle({ ...bookStyle, fontSize: bookStyle.fontSize + 1 }); - let decrementCounter = () => - setBookStyle({ ...bookStyle, fontSize: bookStyle.fontSize - 1 }); + const incrementCounter = () => { + if (bookStyle.fontSize !== 20) { + setBookStyle({ ...bookStyle, fontSize: bookStyle.fontSize + 1 }); + } else { + return; + } + }; + let decrementCounter = () => { + if (bookStyle.fontSize !== 10) { + setBookStyle({ ...bookStyle, fontSize: bookStyle.fontSize - 1 }); + } else { + return; + } + }; return (