import { Docked, OverlappingPanels, ShowIf } from "react-overlapping-panels"; import { Switch, Route, useLocation } from "react-router-dom"; import styled, { css } 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 { 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 InviteBot from "./invite/InviteBot"; import ChannelSettings from "./settings/ChannelSettings"; import ServerSettings from "./settings/ServerSettings"; import Settings from "./settings/Settings"; const AppContainer = styled.div` background-size: cover !important; background-position: center center !important; `; const StatusBar = styled.div` height: 40px; width: 100%; display: flex; align-items: center; justify-content: center; font-size: 13px; gap: 14px; .button { border: 1px solid white; padding: 5px; border-radius: var(--border-radius); } `; const Routes = styled.div` min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--primary-background); /*background-color: rgba( var(--primary-background-rgb), max(var(--min-opacity), 0.75) );*/ //backdrop-filter: blur(10px); ${() => isTouchscreenDevice && css` overflow: hidden; `} `; 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 ( <> {/* Planned outage: CDN (~2 hours) View status */} {window.isNative && !window.native.getConfig().frame && ( )} } } rightPanel={ !inSpecial && inChannel ? { width: 236, component: } : undefined } bottomNav={{ component: , showIf: fixedBottomNav ? ShowIf.Always : ShowIf.Left, height: 50, }} docked={isTouchscreenDevice ? Docked.None : Docked.Left}> > ); }