This commit is contained in:
Ren Amamiya
2023-08-12 11:18:10 +07:00
parent 36b2acba6a
commit bb089bb259
27 changed files with 502 additions and 481 deletions
+7 -7
View File
@@ -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[];
},
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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>