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.tsx27
1 files changed, 10 insertions, 17 deletions
diff --git a/gui/src/Router.tsx b/gui/src/Router.tsx
index ee3aa0d..5026ef0 100644
--- a/gui/src/Router.tsx
+++ b/gui/src/Router.tsx
@@ -1,12 +1,14 @@
import Sidebar from "@/components/layout/Sidebar";
-
-// new
+import useLocalState from "@/state/state";
import Feed from "@/pages/Feed";
+import User from "@/pages/User";
import Settings from "@/pages/Settings";
import Thread from "@/pages/Thread";
import { Switch, Router, Redirect, Route } from "wouter";
+import { P404 } from "./pages/Error";
export default function r() {
+ const modal = useLocalState((s) => s.modal);
return (
<Switch>
<Router base="/apps/nostrill">
@@ -14,26 +16,17 @@ export default function r() {
<main>
<Route path="/" component={toGlobal} />
<Route path="/sets" component={Settings} />
- <Route path="/feed/:taip" component={Feed} />
- <Route path="/feed/:host/:id" component={Thread} />
+ <Route path="/f" component={Feed} />
+ <Route path="/f/:taip" component={Feed} />
+ <Route path="/u/:user" component={User} />
+ <Route path="/t/:host/:id" component={Thread} />
</main>
+ {modal && modal}
</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>
- );
+ return <Redirect to="/f" />;
}