2021-06-19 10:29:04 -04:00
|
|
|
import { Docked, OverlappingPanels } from "react-overlapping-panels";
|
|
|
|
import { isTouchscreenDevice } from "../lib/isTouchscreenDevice";
|
2021-06-19 07:34:53 -04:00
|
|
|
import { Switch, Route } from "react-router-dom";
|
2021-06-19 15:00:30 -04:00
|
|
|
import styled from "styled-components";
|
2021-06-19 07:34:53 -04:00
|
|
|
|
2021-06-19 15:24:11 -04:00
|
|
|
import Popovers from "../context/intermediate/Popovers";
|
|
|
|
import ContextMenus from "../lib/ContextMenus";
|
|
|
|
|
2021-06-19 10:29:04 -04:00
|
|
|
import LeftSidebar from "../components/navigation/LeftSidebar";
|
|
|
|
import RightSidebar from "../components/navigation/RightSidebar";
|
|
|
|
|
2021-06-19 07:34:53 -04:00
|
|
|
import Home from './home/Home';
|
2021-06-19 15:00:30 -04:00
|
|
|
import Friends from "./friends/Friends";
|
2021-06-19 15:24:11 -04:00
|
|
|
import Developer from "./developer/Developer";
|
2021-06-19 15:00:30 -04:00
|
|
|
|
|
|
|
const Routes = styled.div`
|
|
|
|
min-width: 0;
|
|
|
|
display: flex;
|
|
|
|
overflow: hidden;
|
|
|
|
flex-direction: column;
|
|
|
|
background: var(--primary-background);
|
|
|
|
`;
|
2021-06-19 07:34:53 -04:00
|
|
|
|
|
|
|
export default function App() {
|
|
|
|
return (
|
|
|
|
<OverlappingPanels
|
|
|
|
width="100vw"
|
2021-06-19 10:29:04 -04:00
|
|
|
height="100%"
|
|
|
|
leftPanel={{ width: 292, component: <LeftSidebar /> }}
|
|
|
|
rightPanel={{ width: 240, component: <RightSidebar /> }}
|
|
|
|
docked={isTouchscreenDevice ? Docked.None : Docked.Left}>
|
2021-06-19 15:00:30 -04:00
|
|
|
<Routes>
|
|
|
|
<Switch>
|
2021-06-19 15:24:11 -04:00
|
|
|
<Route path="/dev">
|
|
|
|
<Developer />
|
|
|
|
</Route>
|
|
|
|
|
2021-06-19 15:00:30 -04:00
|
|
|
<Route path="/friends">
|
|
|
|
<Friends />
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route path="/">
|
|
|
|
<Home />
|
|
|
|
</Route>
|
|
|
|
</Switch>
|
|
|
|
</Routes>
|
2021-06-19 15:24:11 -04:00
|
|
|
<ContextMenus />
|
2021-06-19 13:46:05 -04:00
|
|
|
<Popovers />
|
2021-06-19 07:34:53 -04:00
|
|
|
</OverlappingPanels>
|
|
|
|
);
|
|
|
|
};
|
2021-06-19 15:00:30 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* <Route path="/channel/:channel/message/:message">
|
|
|
|
<ChannelWrapper />
|
|
|
|
</Route>
|
|
|
|
<Route path="/server/:server/channel/:channel/settings/:page">
|
|
|
|
<ChannelSettings key="channel_settings" />
|
|
|
|
</Route>
|
|
|
|
<Route path="/server/:server/channel/:channel/settings">
|
|
|
|
<ChannelSettings key="channel_settings" />
|
|
|
|
</Route>
|
|
|
|
<Route path="/server/:server/settings/:page">
|
|
|
|
<ServerSettings key="channel_settings" />
|
|
|
|
</Route>
|
|
|
|
<Route path="/server/:server/settings">
|
|
|
|
<ServerSettings key="channel_settings" />
|
|
|
|
</Route>
|
|
|
|
<Route path="/channel/:channel/settings/:page">
|
|
|
|
<ChannelSettings key="channel_settings" />
|
|
|
|
</Route>
|
|
|
|
<Route path="/channel/:channel/settings">
|
|
|
|
<ChannelSettings key="channel_settings" />
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route path="/settings/:page">
|
|
|
|
<Settings key="settings" />
|
|
|
|
</Route>
|
|
|
|
<Route path="/settings">
|
|
|
|
<Settings key="settings" />
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route path="/server/:server/channel/:channel">
|
|
|
|
<ChannelWrapper />
|
|
|
|
</Route>
|
|
|
|
<Route path="/server/:server" />
|
|
|
|
<Route path="/channel/:channel">
|
|
|
|
<ChannelWrapper />
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route path="/friends">
|
|
|
|
<Friends />
|
|
|
|
</Route>
|
|
|
|
<Route path="/dev">
|
|
|
|
<Developer />
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route path="/open/:id">
|
|
|
|
<Open />
|
|
|
|
</Route>
|
|
|
|
{/*<Route path="/invite/:code">
|
|
|
|
<OpenInvite />
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
<Route path="/">
|
|
|
|
<Home />
|
|
|
|
</Route>
|
|
|
|
*/
|