diff --git a/src/components/Note/index.tsx b/src/components/Note/index.tsx index 664a1a3..459f1bd 100644 --- a/src/components/Note/index.tsx +++ b/src/components/Note/index.tsx @@ -1,4 +1,4 @@ -import { useSecondaryPage } from '@/PageManager' +import { usePrimaryPage, useSecondaryPage } from '@/PageManager' import { ExtendedKind, SUPPORTED_KINDS } from '@/constants' import { getParentBech32Id, isNsfwEvent } from '@/lib/event' import { toNote } from '@/lib/link' @@ -17,6 +17,7 @@ import ParentNotePreview from '../ParentNotePreview' import TranslateButton from '../TranslateButton' import UserAvatar from '../UserAvatar' import Username from '../Username' +import { MessageSquare } from 'lucide-react' import CommunityDefinition from './CommunityDefinition' import GroupMetadata from './GroupMetadata' import Highlight from './Highlight' @@ -48,6 +49,7 @@ export default function Note({ showFull?: boolean }) { const { push } = useSecondaryPage() + const { navigate } = usePrimaryPage() const { isSmallScreen } = useScreenSize() const parentEventId = useMemo( () => (hideParentNotePreview ? undefined : getParentBech32Id(event)), @@ -87,7 +89,14 @@ export default function Note({ } else if (event.kind === kinds.CommunityDefinition) { content = } else if (event.kind === ExtendedKind.DISCUSSION) { - content = + const titleTag = event.tags.find(tag => tag[0] === 'title') + const title = titleTag?.[1] || 'Untitled Discussion' + content = ( + <> +

{title}

+ + + ) } else if (event.kind === ExtendedKind.POLL) { content = ( <> @@ -133,7 +142,19 @@ export default function Note({ -
+
+ {event.kind === ExtendedKind.DISCUSSION && ( + + )} {size === 'normal' && ( diff --git a/src/components/NoteOptions/useMenuActions.tsx b/src/components/NoteOptions/useMenuActions.tsx index 68d494a..56e3553 100644 --- a/src/components/NoteOptions/useMenuActions.tsx +++ b/src/components/NoteOptions/useMenuActions.tsx @@ -1,3 +1,4 @@ +import { ExtendedKind } from '@/constants' import { getNoteBech32Id, isProtectedEvent } from '@/lib/event' import { toNjump } from '@/lib/link' import { pubkeyToNpub } from '@/lib/pubkey' @@ -183,7 +184,8 @@ export function useMenuActions({ ] const isProtected = isProtectedEvent(event) - if (!isProtected || event.pubkey === pubkey) { + const isDiscussion = event.kind === ExtendedKind.DISCUSSION + if ((!isProtected || event.pubkey === pubkey) && !isDiscussion) { actions.push({ icon: SatelliteDish, label: t('Republish to ...'),