add trending notes

This commit is contained in:
Ren Amamiya
2023-06-16 10:01:20 +07:00
parent efea63b0a0
commit f8de44fe9f
38 changed files with 155 additions and 308 deletions

View File

@@ -1,4 +1,4 @@
import { MentionUser } from "@app/space/components/notes/mentions/user";
import { MentionUser } from "@shared/notes/mentions/user";
import destr from "destr";
import getUrls from "get-urls";
import { parseReferences } from "nostr-tools";

View File

@@ -1,3 +1,4 @@
import { NDKTag } from "@nostr-dev-kit/ndk";
import destr from "destr";
import { nip19 } from "nostr-tools";
@@ -66,7 +67,7 @@ export function getParentID(arr: string[], fallback: string) {
}
// check id present in event tags
export function isTagsIncludeID(id: string, arr: string[]) {
export function isTagsIncludeID(id: string, arr: NDKTag[]) {
const tags = destr(arr);
if (tags.length > 0) {
@@ -79,7 +80,7 @@ export function isTagsIncludeID(id: string, arr: string[]) {
}
// get parent id from event tags
export function getQuoteID(arr: string[]) {
export function getQuoteID(arr: NDKTag[]) {
const tags = destr(arr);
let quoteID = null;

6
src/utils/types.ts Normal file
View File

@@ -0,0 +1,6 @@
import { NDKEvent } from "@nostr-dev-kit/ndk";
export interface LumeEvent extends NDKEvent {
event_id: string;
parent_id: string;
}