refactor widget
This commit is contained in:
@@ -20,7 +20,7 @@ export function Repost({ event }: { event: NDKEvent }) {
|
||||
|
||||
if (status === 'loading') {
|
||||
return (
|
||||
<div className="h-min w-full px-3 py-1.5">
|
||||
<div className="h-min w-full px-3 pb-3">
|
||||
<div className="relative overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
|
||||
<NoteSkeleton />
|
||||
</div>
|
||||
@@ -30,7 +30,7 @@ export function Repost({ event }: { event: NDKEvent }) {
|
||||
|
||||
if (status === 'error') {
|
||||
return (
|
||||
<div className="h-min w-full px-3 py-1.5">
|
||||
<div className="h-min w-full px-3 pb-3">
|
||||
<div className="flex flex-col gap-1 overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
|
||||
<p className="select-text break-all text-white/50">
|
||||
Failed to get repost with ID
|
||||
@@ -57,7 +57,7 @@ export function Repost({ event }: { event: NDKEvent }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="h-min w-full px-3 py-1.5">
|
||||
<div className="h-min w-full px-3 pb-3">
|
||||
<div className="relative overflow-hidden rounded-xl bg-white/10 px-3 pt-3 backdrop-blur-xl">
|
||||
<div className="relative flex flex-col">
|
||||
<div className="isolate flex flex-col -space-y-4">
|
||||
|
||||
@@ -11,7 +11,7 @@ export function Hashtag({ tag }: { tag: string }) {
|
||||
type="button"
|
||||
onClick={() =>
|
||||
setWidget(db, {
|
||||
kind: WidgetKinds.hashtag,
|
||||
kind: WidgetKinds.global.hashtag,
|
||||
title: tag,
|
||||
content: tag.replace('#', ''),
|
||||
})
|
||||
|
||||
@@ -25,7 +25,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) {
|
||||
const openThread = (event, thread: string) => {
|
||||
const selection = window.getSelection();
|
||||
if (selection.toString().length === 0) {
|
||||
setWidget(db, { kind: WidgetKinds.thread, title: 'Thread', content: thread });
|
||||
setWidget(db, { kind: WidgetKinds.local.thread, title: 'Thread', content: thread });
|
||||
} else {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function MentionUser({ pubkey }: { pubkey: string }) {
|
||||
type="button"
|
||||
onClick={() =>
|
||||
setWidget(db, {
|
||||
kind: WidgetKinds.user,
|
||||
kind: WidgetKinds.local.user,
|
||||
title: user?.nip05 || user?.name || user?.display_name,
|
||||
content: pubkey,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user