feat(popup): add quote-repost dropdown for note popup
This commit is contained in:
parent
2d5088b984
commit
9cc98ea6e4
@ -188,6 +188,8 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const [showQuoteReposts, setShowQuoteReposts] = useState(false)
|
||||||
|
|
||||||
const handleRepost = async (confirm: boolean) => {
|
const handleRepost = async (confirm: boolean) => {
|
||||||
if (navigation.state !== 'idle') return
|
if (navigation.state !== 'idle') return
|
||||||
|
|
||||||
@ -452,7 +454,35 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
|
|||||||
{commentEvents.length > 0 && (
|
{commentEvents.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<h3 className='IBMSMSMBSSCL_CommentNoteRepliesTitle'>
|
<h3 className='IBMSMSMBSSCL_CommentNoteRepliesTitle'>
|
||||||
Replies
|
{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
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
className='btnMain IBMSMSMBSSCL_CommentNoteRepliesTitleBtn'
|
className='btnMain IBMSMSMBSSCL_CommentNoteRepliesTitleBtn'
|
||||||
@ -475,9 +505,13 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
|
|||||||
</button>
|
</button>
|
||||||
</h3>
|
</h3>
|
||||||
<div className='pUMCB_RepliesToPrime'>
|
<div className='pUMCB_RepliesToPrime'>
|
||||||
{commentEvents.map((reply) => (
|
{showQuoteReposts
|
||||||
<Comment key={reply.event.id} comment={reply} />
|
? quoteRepostEvents.map((reply) => (
|
||||||
))}
|
<Comment key={reply.id} comment={{ event: reply }} />
|
||||||
|
))
|
||||||
|
: commentEvents.map((reply) => (
|
||||||
|
<Comment key={reply.event.id} comment={reply} />
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user