feat(column): add hashtag column

This commit is contained in:
2023-12-30 17:33:04 +07:00
parent ddbbcf41b5
commit b1d2496f8e
22 changed files with 533 additions and 52 deletions

View File

@@ -372,8 +372,6 @@ export class Ark {
signal?: AbortSignal;
dedup?: boolean;
}) {
if (!filter?.authors?.length) return [];
const rootIds = new Set();
const dedupQueue = new Set();
const connectedRelays = this.ndk.pool

View File

@@ -1,5 +1,5 @@
import { IColumn } from "@lume/types";
import { WIDGET_KIND } from "@lume/utils";
import { COL_TYPES } from "@lume/utils";
import { NDKEvent } from "@nostr-dev-kit/ndk";
import {
ReactNode,
@@ -27,7 +27,7 @@ export function ColumnProvider({ children }: { children: ReactNode }) {
id: "9999",
title: "Newsfeed",
content: "",
kind: WIDGET_KIND.newsfeed,
kind: COL_TYPES.newsfeed,
},
]);

View File

@@ -1,5 +1,5 @@
import { PinIcon } from "@lume/icons";
import { WIDGET_KIND } from "@lume/utils";
import { COL_TYPES } from "@lume/utils";
import * as Tooltip from "@radix-ui/react-tooltip";
import { useNoteContext } from "..";
import { useColumnContext } from "../../column";
@@ -16,7 +16,7 @@ export function NotePin() {
type="button"
onClick={() =>
addColumn({
kind: WIDGET_KIND.thread,
kind: COL_TYPES.thread,
title: "Thread",
content: event.id,
})

View File

@@ -1,4 +1,4 @@
import { WIDGET_KIND } from "@lume/utils";
import { COL_TYPES } from "@lume/utils";
import { useColumnContext } from "../../column";
export function Hashtag({ tag }: { tag: string }) {
@@ -9,9 +9,9 @@ export function Hashtag({ tag }: { tag: string }) {
type="button"
onClick={() =>
addColumn({
kind: WIDGET_KIND.hashtag,
kind: COL_TYPES.hashtag,
title: tag,
content: tag.replace("#", ""),
content: tag,
})
}
className="cursor-default break-all text-blue-500 hover:text-blue-600"

View File

@@ -1,4 +1,4 @@
import { WIDGET_KIND } from "@lume/utils";
import { COL_TYPES } from "@lume/utils";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { memo } from "react";
import { Link } from "react-router-dom";
@@ -30,7 +30,7 @@ export const MentionUser = memo(function MentionUser({
type="button"
onClick={() =>
addColumn({
kind: WIDGET_KIND.user,
kind: COL_TYPES.user,
title: user?.name || user?.displayName || "",
content: pubkey,
})