wip: rework widget

This commit is contained in:
2023-11-09 18:02:25 +07:00
parent cb9006abb2
commit 0cdf199cb5
31 changed files with 155 additions and 509 deletions

View File

@@ -34,7 +34,7 @@ export function NoteActions({
type="button"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.local.thread,
kind: WIDGET_KIND.thread,
title: 'Thread',
content: id,
})

View File

@@ -10,7 +10,7 @@ export function Hashtag({ tag }: { tag: string }) {
type="button"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.global.hashtag,
kind: WIDGET_KIND.hashtag,
title: tag,
content: tag.replace('#', ''),
})

View File

@@ -50,7 +50,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) {
type="button"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.local.thread,
kind: WIDGET_KIND.thread,
title: 'Thread',
content: data.id,
})

View File

@@ -14,14 +14,7 @@ export const MentionUser = memo(function MentionUser({ pubkey }: { pubkey: strin
type="button"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.local.user,
title: user?.name || user?.display_name || user?.displayName,
content: pubkey,
})
}
onKeyDown={() =>
addWidget.mutate({
kind: WIDGET_KIND.local.user,
kind: WIDGET_KIND.user,
title: user?.name || user?.display_name || user?.displayName,
content: pubkey,
})

View File

@@ -91,7 +91,7 @@ export function NotifyNote({ event }: { event: NDKEvent }) {
type="button"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.local.thread,
kind: WIDGET_KIND.thread,
title: 'Thread',
content: data.id,
})

View File

@@ -30,7 +30,7 @@ export function TextNote({ event }: { event: NDKEvent }) {
type="button"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.local.thread,
kind: WIDGET_KIND.thread,
title: 'Thread',
content: thread.rootEventId,
})