mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-19 12:00:32 +02:00
support badge definition link
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Alert, AlertIcon, AlertTitle } from "@chakra-ui/react";
|
||||
import { Navigate, useParams } from "react-router-dom";
|
||||
import { nip19 } from "nostr-tools";
|
||||
import { Kind, nip19 } from "nostr-tools";
|
||||
import { STREAM_KIND } from "../../helpers/nostr/stream";
|
||||
import { EMOJI_PACK_KIND } from "../../helpers/nostr/emoji-packs";
|
||||
import { NOTE_LIST_KIND, PEOPLE_LIST_KIND } from "../../helpers/nostr/lists";
|
||||
import { ErrorBoundary } from "../../components/error-boundary";
|
||||
import { COMMUNITY_DEFINITION_KIND } from "../../helpers/nostr/communities";
|
||||
import { decode } from "ngeohash";
|
||||
|
||||
function NostrLinkPage() {
|
||||
const { link } = useParams() as { link?: string };
|
||||
@@ -33,7 +34,8 @@ function NostrLinkPage() {
|
||||
if (decoded.data.kind === EMOJI_PACK_KIND) return <Navigate to={`/emojis/${cleanLink}`} replace />;
|
||||
if (decoded.data.kind === NOTE_LIST_KIND) return <Navigate to={`/lists/${cleanLink}`} replace />;
|
||||
if (decoded.data.kind === PEOPLE_LIST_KIND) return <Navigate to={`/lists/${cleanLink}`} replace />;
|
||||
if (decoded.data.kind === COMMUNITY_DEFINITION_KIND) return <Navigate to={`/c/${cleanLink}`} />;
|
||||
if (decoded.data.kind === Kind.BadgeDefinition) return <Navigate to={`/badges/${cleanLink}`} replace />;
|
||||
if (decoded.data.kind === COMMUNITY_DEFINITION_KIND) return <Navigate to={`/c/${cleanLink}`} replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user