mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 00:17:02 +02:00
This commit adds dedicated preview routes for Nostr identifiers at the root level: - /npub... - Shows a single profile view for npub identifiers - /nevent... - Shows a single event detail view for nevent identifiers - /note... - Shows a single event detail view for note identifiers - /naddr... - Redirects spellbooks (kind 30777) to /:actor/:identifier route Key changes: - Created PreviewProfilePage component for npub identifiers - Created PreviewEventPage component for nevent/note identifiers - Created PreviewAddressPage component for naddr redirects - Added hideBottomBar prop to AppShell to hide tabs in preview mode - Added routes to root.tsx for all identifier types Preview pages don't show bottom tabs and don't affect user's workspace layout.
71 lines
1.5 KiB
TypeScript
71 lines
1.5 KiB
TypeScript
import { createBrowserRouter, RouterProvider } from "react-router";
|
|
import { AppShell } from "./components/layouts/AppShell";
|
|
import DashboardPage from "./components/pages/DashboardPage";
|
|
import SpellbookPage from "./components/pages/SpellbookPage";
|
|
import PreviewProfilePage from "./components/pages/PreviewProfilePage";
|
|
import PreviewEventPage from "./components/pages/PreviewEventPage";
|
|
import PreviewAddressPage from "./components/pages/PreviewAddressPage";
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: "/",
|
|
element: (
|
|
<AppShell>
|
|
<DashboardPage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
{
|
|
path: "/npub:identifier",
|
|
element: (
|
|
<AppShell hideBottomBar>
|
|
<PreviewProfilePage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
{
|
|
path: "/nevent:identifier",
|
|
element: (
|
|
<AppShell hideBottomBar>
|
|
<PreviewEventPage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
{
|
|
path: "/note:identifier",
|
|
element: (
|
|
<AppShell hideBottomBar>
|
|
<PreviewEventPage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
{
|
|
path: "/naddr:identifier",
|
|
element: (
|
|
<AppShell hideBottomBar>
|
|
<PreviewAddressPage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
{
|
|
path: "/preview/:actor/:identifier",
|
|
element: (
|
|
<AppShell>
|
|
<SpellbookPage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
{
|
|
path: "/:actor/:identifier",
|
|
element: (
|
|
<AppShell>
|
|
<SpellbookPage />
|
|
</AppShell>
|
|
),
|
|
},
|
|
]);
|
|
|
|
export default function Root() {
|
|
return <RouterProvider router={router} />;
|
|
}
|