feat(popup): add quote-repost dropdown for note popup

This commit is contained in:
en 2025-02-25 11:57:51 +01:00
parent 2d5088b984
commit 9cc98ea6e4

View File

@ -188,6 +188,8 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
})
})
const [showQuoteReposts, setShowQuoteReposts] = useState(false)
const handleRepost = async (confirm: boolean) => {
if (navigation.state !== 'idle') return
@ -452,7 +454,35 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
{commentEvents.length > 0 && (
<>
<h3 className='IBMSMSMBSSCL_CommentNoteRepliesTitle'>
{isNote ? (
<div className='dropdown'>
<button
className='btn dropdown-toggle btnMain btnMainDropdown'
aria-expanded='false'
data-bs-toggle='dropdown'
type='button'
>
{showQuoteReposts ? 'Quote-Reposts' : 'Replies'}
</button>
<div className='dropdown-menu dropdownMainMenu'>
<div
className='dropdown-item dropdownMainMenuItem'
onClick={() => setShowQuoteReposts(false)}
>
Replies
</div>
<div
className='dropdown-item dropdownMainMenuItem'
onClick={() => setShowQuoteReposts(true)}
>
Quote-Reposts
</div>
</div>
</div>
) : (
<>Replies</>
)}
<button
type='button'
className='btnMain IBMSMSMBSSCL_CommentNoteRepliesTitleBtn'
@ -475,7 +505,11 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
</button>
</h3>
<div className='pUMCB_RepliesToPrime'>
{commentEvents.map((reply) => (
{showQuoteReposts
? quoteRepostEvents.map((reply) => (
<Comment key={reply.id} comment={{ event: reply }} />
))
: commentEvents.map((reply) => (
<Comment key={reply.event.id} comment={reply} />
))}
</div>