mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 01:11:25 +00:00
hide nonpow replies and fix quotes
This commit is contained in:
parent
1b7f904711
commit
99337afedd
@ -91,6 +91,7 @@ const NewNoteCard = ({
|
|||||||
break;
|
break;
|
||||||
case 'Quote':
|
case 'Quote':
|
||||||
unsigned.tags.push(['q', refEvent.id]);
|
unsigned.tags.push(['q', refEvent.id]);
|
||||||
|
setComment(comment + '\nnostr:' + nip19.noteEncode(refEvent.id));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
addEventTags();
|
addEventTags();
|
||||||
|
@ -51,6 +51,7 @@ const Thread = () => {
|
|||||||
return () => window.removeEventListener("scroll", handleScroll);
|
return () => window.removeEventListener("scroll", handleScroll);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const [showAllReplies, setShowAllReplies] = useState(false);
|
||||||
if (OPEvent) {
|
if (OPEvent) {
|
||||||
const uniqEvents = uniqBy(prevMentions, "id");
|
const uniqEvents = uniqBy(prevMentions, "id");
|
||||||
const earlierEvents = uniqEvents
|
const earlierEvents = uniqEvents
|
||||||
@ -79,8 +80,15 @@ const Thread = () => {
|
|||||||
</div>
|
</div>
|
||||||
<ThreadPostModal OPEvent={OPEvent} />
|
<ThreadPostModal OPEvent={OPEvent} />
|
||||||
<div className="col-span-full h-0.5 bg-neutral-900 mb-2"/> {/* This is the white line separator */}
|
<div className="col-span-full h-0.5 bg-neutral-900 mb-2"/> {/* This is the white line separator */}
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<button onClick={() => setShowAllReplies(!showAllReplies)} className="text-neutral-600 text-xs border border-neutral-700 rounded-md px-4 py-2">
|
||||||
|
{showAllReplies ? 'Hide 0 PoW Replies' : 'Show All Replies'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div className="grid grid-cols-1 max-w-xl mx-auto gap-1">
|
<div className="grid grid-cols-1 max-w-xl mx-auto gap-1">
|
||||||
{replyEvents.slice(0, visibleReplyEvents).map((event: Event) => (
|
{replyEvents.slice(0, visibleReplyEvents)
|
||||||
|
.filter((event: Event) => (showAllReplies || event.id.startsWith('0')) && event.tags.some(tag => tag[0] === 'e' && tag[1] === OPEvent.id))
|
||||||
|
.map((event: Event) => (
|
||||||
<div className={`w-11/12 ${event.tags.find(tag => tag[0] === 'e' && tag[1] !== OPEvent.id) ? 'ml-auto' : 'mr-auto'}`}>
|
<div className={`w-11/12 ${event.tags.find(tag => tag[0] === 'e' && tag[1] !== OPEvent.id) ? 'ml-auto' : 'mr-auto'}`}>
|
||||||
<PostCard
|
<PostCard
|
||||||
key={event.id}
|
key={event.id}
|
||||||
|
Loading…
Reference in New Issue
Block a user