polish
This commit is contained in:
@@ -12,16 +12,16 @@ import { nHoursAgo } from '@utils/date';
|
||||
import { LumeEvent } from '@utils/types';
|
||||
|
||||
export function NotificationModal({ pubkey }: { pubkey: string }) {
|
||||
const { fetcher, relayUrls } = useNDK();
|
||||
const { ndk } = useNDK();
|
||||
const { status, data } = useQuery(
|
||||
['notification', pubkey],
|
||||
async () => {
|
||||
const events = await fetcher.fetchAllEvents(
|
||||
relayUrls,
|
||||
{ '#p': [pubkey], kinds: [1, 6, 7, 9735] },
|
||||
{ since: nHoursAgo(24) }
|
||||
);
|
||||
const filterSelf = events.filter((el) => el.pubkey !== pubkey);
|
||||
const events = await ndk.fetchEvents({
|
||||
'#p': [pubkey],
|
||||
kinds: [1, 6, 7, 9735],
|
||||
since: nHoursAgo(24),
|
||||
});
|
||||
const filterSelf = [...events].filter((el) => el.pubkey !== pubkey);
|
||||
const sorted = filterSelf.sort((a, b) => a.created_at - b.created_at);
|
||||
return sorted as unknown as LumeEvent[];
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ export function NotiMention({ event }: { event: NDKEvent }) {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex items-start gap-1">
|
||||
<NotiUser pubkey={event.pubkey} />
|
||||
<p className="leading-none text-white/50">reply your post</p>
|
||||
<p className="leading-none text-white/50">reply your postr</p>
|
||||
</div>
|
||||
<span className="leading-none text-white/50">{createdAt}</span>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ export function NotiRepost({ event }: { event: NDKEvent }) {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex items-start gap-1">
|
||||
<NotiUser pubkey={event.pubkey} />
|
||||
<p className="leading-none text-white/50">repost your post</p>
|
||||
<p className="leading-none text-white/50">repost your postr</p>
|
||||
</div>
|
||||
<div>
|
||||
<span className="leading-none text-white/50">{createdAt}</span>
|
||||
|
||||
Reference in New Issue
Block a user