mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 07:22:10 -05:00
fix(sidebar): force open on mobile devices
This commit is contained in:
parent
8a0033699d
commit
d7f52fb6f4
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Route, Switch } from "react-router";
|
import { Route, Switch } from "react-router";
|
||||||
|
|
||||||
|
import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
|
||||||
|
|
||||||
import { useApplicationState } from "../../mobx/State";
|
import { useApplicationState } from "../../mobx/State";
|
||||||
import { SIDEBAR_CHANNELS } from "../../mobx/stores/Layout";
|
import { SIDEBAR_CHANNELS } from "../../mobx/stores/Layout";
|
||||||
|
|
||||||
|
@ -11,7 +13,8 @@ import ServerSidebar from "./left/ServerSidebar";
|
||||||
|
|
||||||
export default observer(() => {
|
export default observer(() => {
|
||||||
const layout = useApplicationState().layout;
|
const layout = useApplicationState().layout;
|
||||||
const isOpen = layout.getSectionState(SIDEBAR_CHANNELS, true);
|
const isOpen =
|
||||||
|
isTouchscreenDevice || layout.getSectionState(SIDEBAR_CHANNELS, true);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarBase>
|
<SidebarBase>
|
||||||
|
|
Loading…
Reference in a new issue