forked from revoltchat/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContent.tsx
52 lines (47 loc) · 1.36 KB
/
Content.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { Component, Match, Switch, onMount } from "solid-js";
import { modalController } from "@revolt/modal";
import { Navigate, Route, useParams } from "@revolt/routing";
import { state } from "@revolt/state";
import { DevelopmentPage } from "./Development";
import { Friends } from "./Friends";
import { HomePage } from "./Home";
import { ServerHome } from "./ServerHome";
import { ChannelPage } from "./channels/ChannelPage";
/**
* Render content without sidebars
*/
export const Content: Component = () => {
const params = useParams<{
server?: string;
channel?: string;
any?: string;
}>();
return (
<Switch fallback={<HomePage />}>
<Match when={params.channel}>
<ChannelPage />
</Match>
<Match when={params.server}>
<ServerHome />
</Match>
</Switch>
);
/*return (
<>
<Route
path="/server/:server/*"
element={
<>
<Route path="/channel/:channel/*" component={ChannelPage} />
<Route path="/*" component={ServerHome} />
</>
}
/>
<Route path="/channel/:channel/*" component={ChannelPage} />
<Route path="/dev" component={DevelopmentPage} />
<Route path="/friends" component={Friends} />
<Route path="/app" component={HomePage} />
<Route path="/" element={<Navigate href="/app" />} />
</>
);*/
};