summaryrefslogtreecommitdiff
path: root/gui/src/Router.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/Router.tsx')
-rw-r--r--gui/src/Router.tsx39
1 files changed, 39 insertions, 0 deletions
diff --git a/gui/src/Router.tsx b/gui/src/Router.tsx
new file mode 100644
index 0000000..ee3aa0d
--- /dev/null
+++ b/gui/src/Router.tsx
@@ -0,0 +1,39 @@
+import Sidebar from "@/components/layout/Sidebar";
+
+// new
+import Feed from "@/pages/Feed";
+import Settings from "@/pages/Settings";
+import Thread from "@/pages/Thread";
+import { Switch, Router, Redirect, Route } from "wouter";
+
+export default function r() {
+ return (
+ <Switch>
+ <Router base="/apps/nostrill">
+ <Sidebar />
+ <main>
+ <Route path="/" component={toGlobal} />
+ <Route path="/sets" component={Settings} />
+ <Route path="/feed/:taip" component={Feed} />
+ <Route path="/feed/:host/:id" component={Thread} />
+ </main>
+ </Router>
+ <Route component={P404} />
+ </Switch>
+ );
+}
+function toGlobal() {
+ return <Redirect to="/feed/nostr" />;
+}
+
+export function P404() {
+ return <h1 className="x-center">404</h1>;
+}
+export function ErrorPage({ msg }: { msg: string }) {
+ return (
+ <div>
+ <P404 />
+ <h3>{msg}</h3>
+ </div>
+ );
+}