Skip to content

Commit

Permalink
feat(ui): use different idle value for desktop and mobile
Browse files Browse the repository at this point in the history
Very simple version, no resize handling, but it will cover 95% cases
  • Loading branch information
prymitive committed Sep 22, 2018
1 parent cc01e07 commit bdbffd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/src/Components/NavBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import { FilterInput } from "./FilterInput";

import "./index.css";

const DesktopIdleTimeout = 1000 * 60 * 3;
const MobileIdleTimeout = 1000 * 5;

const NavbarOnResize = function(width, height) {
document.body.style["padding-top"] = `${height + 4}px`;
};
Expand Down Expand Up @@ -66,7 +69,9 @@ const NavBar = observer(
<IdleTimer
onActive={this.activityStatus.setActive}
onIdle={this.activityStatus.setIdle}
timeout={1000 * 60 * 3}
timeout={
window.innerWidth >= 768 ? DesktopIdleTimeout : MobileIdleTimeout
}
>
<DropdownSlide
in={!this.activityStatus.idle}
Expand Down

0 comments on commit bdbffd1

Please sign in to comment.