import { Docked, OverlappingPanels, ShowIf } from "react-overlapping-panels"; import { Switch, Route, useLocation } from "react-router-dom"; import styled from "styled-components"; import ContextMenus from "../lib/ContextMenus"; import { isTouchscreenDevice } from "../lib/isTouchscreenDevice"; import Popovers from "../context/intermediate/Popovers"; import Notifications from "../context/revoltjs/Notifications"; import StateMonitor from "../context/revoltjs/StateMonitor"; import SyncManager from "../context/revoltjs/SyncManager"; import { Titlebar } from "../components/native/Titlebar"; import BottomNavigation from "../components/navigation/BottomNavigation"; import LeftSidebar from "../components/navigation/LeftSidebar"; import RightSidebar from "../components/navigation/RightSidebar"; import Open from "./Open"; import Channel from "./channels/Channel"; import Developer from "./developer/Developer"; import Friends from "./friends/Friends"; import Home from "./home/Home"; import Invite from "./invite/Invite"; import ChannelSettings from "./settings/ChannelSettings"; import ServerSettings from "./settings/ServerSettings"; import Settings from "./settings/Settings"; const Routes = styled.div` min-width: 0; display: flex; overflow: hidden; flex-direction: column; background: var(--primary-background); `; export default function App() { const path = useLocation().pathname; const fixedBottomNav = path === "/" || path === "/settings" || path.startsWith("/friends"); const inChannel = path.includes("/channel"); const inSpecial = (path.startsWith("/friends") && isTouchscreenDevice) || path.startsWith("/invite") || path.includes("/settings"); return ( <> {window.isNative && !window.native.getConfig().frame && ( )} } } rightPanel={ !inSpecial && inChannel ? { width: 240, component: } : undefined } bottomNav={{ component: , showIf: fixedBottomNav ? ShowIf.Always : ShowIf.Left, height: 50, }} docked={isTouchscreenDevice ? Docked.None : Docked.Left}> ); }