diff --git a/src/components/PostEditor/PostContent.tsx b/src/components/PostEditor/PostContent.tsx index 3af4cb1d..d4bbd705 100644 --- a/src/components/PostEditor/PostContent.tsx +++ b/src/components/PostEditor/PostContent.tsx @@ -10,6 +10,8 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { @@ -196,6 +198,7 @@ export default function PostContent({ ) const [text, setText] = useState('') const textareaRef = useRef(null) + const mediaUploaderBtnRef = useRef(null) const [posting, setPosting] = useState(false) const [uploadProgresses, setUploadProgresses] = useState< { file: File; progress: number; cancel: () => void }[] @@ -2673,168 +2676,190 @@ export default function PostContent({ mediaImetaTags={mediaImetaTags} mediaUrl={mediaUrl} headerActions={ - <> - {/* Media button - show for new posts only (replies have audio button at bottom) */} - {!parentEvent && ( - <> - - - - - - )} - {/* Note creation buttons - only show when not replying */} - {!parentEvent && ( - <> - - - - - {/* Article dropdown - only show if has private relays for publication content */} - {(hasPrivateRelaysAvailable || !isPublicationContent) && ( - - - - - - handleArticleToggle('longform')}> - {t('Long-form Article')} + + + + {t('Note type')} + + + +
+ {t('Short Note')} + {t('Plain text note (kind 1)')} +
+ {isPlainShortNoteToolbar && } +
+ mediaUploaderBtnRef.current?.click()} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Media Note')} + {t('Attach image, audio, or video')} +
+ {mediaNoteKind !== null && } +
+ + + +
+ {t('Highlight')} + {t('Save a quote or passage')} +
+ {isHighlight && } +
+ + +
+ {t('Public Message')} + {t('Public direct message (kind 4)')} +
+ {isPublicMessage && } +
+ + +
+ {t('Poll')} + {t('Create a voting poll')} +
+ {isPoll && } +
+ checkLogin(() => handleDiscussionThreadToggle())} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Thread')} + {t('Start a discussion thread')} +
+ {isDiscussionThread && } +
+ + + {t('Articles')} + + handleArticleToggle('longform')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Long-form Article')} + {t('Markdown article (NIP-23)')} +
+ {isLongFormArticle && } +
+ handleArticleToggle('wiki')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Wiki Article (AsciiDoc)')} + {t('AsciiDoc wiki contribution')} +
+ {isWikiArticle && } +
+ handleArticleToggle('wiki-markdown')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Wiki Article (Markdown)')} + {t('Markdown wiki contribution')} +
+ {isWikiArticleMarkdown && } +
+ {hasPrivateRelaysAvailable && ( + handleArticleToggle('publication')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Publication Note')} + {t('Private relay publication')} +
+ {isPublicationContent && } +
+ )} + + + {t('Citations')} + + {hasPrivateRelaysAvailable ? ( + <> + handleCitationToggle('internal')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Internal Citation')} + {t('Cite from private relay')} +
+ {isCitationInternal && }
- handleArticleToggle('wiki')}> - {t('Wiki Article (AsciiDoc)')} + handleCitationToggle('external')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('External Citation')} + {t('Cite from external source')} +
+ {isCitationExternal && }
- handleArticleToggle('wiki-markdown')}> - {t('Wiki Article (Markdown)')} + handleCitationToggle('hardcopy')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Hardcopy Citation')} + {t('Physical source citation')} +
+ {isCitationHardcopy && }
- {hasPrivateRelaysAvailable && ( - handleArticleToggle('publication')}> - {t('Take a note')} - - )} -
-
- )} - {/* Citations (private relays) */} - - - - - - {hasPrivateRelaysAvailable ? ( - <> - handleCitationToggle('internal')}> - {t('Internal Citation')} - - handleCitationToggle('external')}> - {t('External Citation')} - - handleCitationToggle('hardcopy')}> - {t('Hardcopy Citation')} - - handleCitationToggle('prompt')}> - {t('Prompt Citation')} - - - ) : ( -
- {t('Citations require private relays (NIP-65).')} -
- )} -
-
- - - )} - + handleCitationToggle('prompt')} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Prompt Citation')} + {t('AI / LLM prompt citation')} +
+ {isCitationPrompt && } +
+ + ) : ( +
+ {t('Citations require private relays (NIP-65).')} +
+ )} + + checkLogin(() => setCreateCustomEventOpen(true))} className="gap-3 py-2 cursor-pointer"> + +
+ {t('Custom Event')} + {t('Create event with custom kind')} +
+
+ + + ) + })() : undefined } /> {isDiscussionThread && !parentEvent && ( @@ -2930,6 +2955,19 @@ export default function PostContent({ )} )} + {/* Hidden uploader for the "Media Note" dropdown item */} + {!parentEvent && ( + +