feat: open all profile links within app instead of external portals

- Update nostrUriResolver to return internal /p/:npub links for npub/nprofile
- Replace external profile links with React Router Link components
- Update ResolvedMention, LargeView, and CardView components
- Convert nprofile to npub before routing
- Keep note/nevent links as external (no internal viewer yet)
This commit is contained in:
Gigi
2025-10-14 01:32:28 +02:00
parent cfc12e2d78
commit 28316a71c5
4 changed files with 23 additions and 21 deletions

View File

@@ -39,7 +39,7 @@ export function extractNaddrUris(text: string): string[] {
/**
* Decode a NIP-19 identifier and return a human-readable link
* For articles (naddr), returns an internal app link
* For articles (naddr) and profiles (npub/nprofile), returns internal app links
* For other types, returns an external gateway link
*/
export function createNostrLink(encoded: string): string {
@@ -51,7 +51,13 @@ export function createNostrLink(encoded: string): string {
// For articles, link to our internal app route
return `/a/${encoded}`
case 'npub':
case 'nprofile':
// For profiles, link to our internal app route
return `/p/${encoded}`
case 'nprofile': {
// For nprofile, convert to npub and link to our internal app route
const npub = npubEncode(decoded.data.pubkey)
return `/p/${npub}`
}
case 'note':
case 'nevent':
return getNostrUrl(encoded)