Render progress bars only when visible
This commit is contained in:
@@ -50,6 +50,10 @@ const BaseMobileReaderProgressBar = ({
|
|||||||
return () => setIsMaximized(false);
|
return () => setIsMaximized(false);
|
||||||
}, [isVisible]);
|
}, [isVisible]);
|
||||||
|
|
||||||
|
if (!isVisible) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReaderProgressBarDirectionWrapper>
|
<ReaderProgressBarDirectionWrapper>
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ const BaseStandardReaderProgressBar = ({
|
|||||||
const isHidden = progressBarType === ProgressBarType.HIDDEN;
|
const isHidden = progressBarType === ProgressBarType.HIDDEN;
|
||||||
const isMinimized = !isMaximized && !isDragging;
|
const isMinimized = !isMaximized && !isDragging;
|
||||||
|
|
||||||
|
if (isHidden) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// the progress bar uses the reading direction to set the themes direction, thus, stuff has to be adjusted to still be correctly positioned
|
// the progress bar uses the reading direction to set the themes direction, thus, stuff has to be adjusted to still be correctly positioned
|
||||||
// depending on which combination of theme direction and reading direction is currently active
|
// depending on which combination of theme direction and reading direction is currently active
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user