expt: disable note metadata

This commit is contained in:
Ren Amamiya 2023-09-02 17:28:05 +07:00
parent 4309f734b6
commit 37668393f1
5 changed files with 6 additions and 11 deletions

View File

@ -18,7 +18,7 @@ export const SimpleNote = memo(function SimpleNote({ 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();
}

View File

@ -61,7 +61,7 @@ export function NoteActions({
type="button"
onClick={() =>
setWidget(db, {
kind: WidgetKinds.thread,
kind: WidgetKinds.local.thread,
title: 'Thread',
content: id,
})

View File

@ -5,7 +5,6 @@ import {
ArticleNote,
FileNote,
NoteActions,
NoteMetadata,
NoteSkeleton,
RepostUser,
TextNote,
@ -62,7 +61,7 @@ export function Repost({ event }: { event: NDKEvent }) {
return (
<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 overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
<div className="relative flex flex-col">
<div className="isolate flex flex-col -space-y-4">
<RepostUser pubkey={event.pubkey} />
@ -75,7 +74,6 @@ export function Repost({ event }: { event: NDKEvent }) {
<NoteActions id={repostID} pubkey={data.pubkey} />
</div>
</div>
<NoteMetadata id={repostID} />
</div>
</div>
</div>

View File

@ -95,7 +95,7 @@ export function NoteMetadata({ id }: { id: string }) {
type="button"
onClick={() =>
setWidget(db, {
kind: WidgetKinds.thread,
kind: WidgetKinds.local.thread,
title: 'Thread',
content: id,
})

View File

@ -1,26 +1,24 @@
import { NDKEvent } from '@nostr-dev-kit/ndk';
import { ReactNode } from 'react';
import { ChildNote, NoteActions, NoteMetadata } from '@shared/notes';
import { ChildNote, NoteActions } from '@shared/notes';
import { User } from '@shared/user';
export function NoteWrapper({
event,
children,
meta = true,
root,
reply,
}: {
event: NDKEvent;
children: ReactNode;
repost?: boolean;
meta?: boolean;
root?: string;
reply?: string;
}) {
return (
<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 overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
<div className="relative">{root && <ChildNote id={root} />}</div>
<div className="relative">{reply && <ChildNote id={reply} root={root} />}</div>
<div className="relative flex flex-col">
@ -32,7 +30,6 @@ export function NoteWrapper({
<NoteActions id={event.id} pubkey={event.pubkey} />
</div>
</div>
{meta ? <NoteMetadata id={event.id} /> : <div className="pb-3" />}
</div>
</div>
</div>