mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 07:27:23 +02:00
d912d5fce78b04f1fc8b56b1b9ac33231c876d5e
Previous attempts using wildcard routes didn't work properly in React Router v7. Solution: - Single /:identifier route with a loader that validates NIP-19 prefixes - Loader throws 404 if identifier doesn't start with npub1/note1/nevent1/naddr1 - Created Nip19PreviewRouter component that routes to correct preview page - Routes are properly ordered: /:identifier before /:actor/:identifier catch-all This ensures /npub107jk... routes to profile preview, not spellbook route. Benefits: - Simpler routing configuration (1 route vs 4 duplicate routes) - Proper validation via loader - Clean separation of concerns with router component - Works correctly in React Router v7
Languages
TypeScript
98.9%
CSS
0.8%
JavaScript
0.3%