This repository has been archived on 2025-11-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
parandum/src/RouteChangeTracker.js
T
mg efc58ff390 [FIX] Content being hidden after logging in
Ensure overflow is only disabled when login page is showing
2021-09-11 17:43:33 +01:00

14 lines
332 B
JavaScript

import { withRouter } from "react-router-dom";
export default withRouter(function RouteChangeTracker({ history, logEvent }) {
history.listen((location, action) => {
if (location.pathname === "/login") {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "auto";
}
});
return null;
})