fixed build errors
This commit is contained in:
@@ -8,7 +8,7 @@ import destr from 'destr';
|
||||
import { memo, useMemo } from 'react';
|
||||
import reactStringReplace from 'react-string-replace';
|
||||
|
||||
export const NoteContent = memo(function NoteContent({ data }: { data: any }) {
|
||||
export const Content = memo(function Content({ data }: { data: any }) {
|
||||
const content = useMemo(() => {
|
||||
let parsedContent;
|
||||
// get data tags
|
||||
|
||||
@@ -6,6 +6,7 @@ import { relaysAtom } from '@stores/relays';
|
||||
|
||||
import { dateToUnix } from '@utils/getDate';
|
||||
|
||||
import destr from 'destr';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
import { useContext, useState } from 'react';
|
||||
@@ -17,7 +18,7 @@ export default function FormComment({ eventID }: { eventID: any }) {
|
||||
const [activeAccount] = useAtom(activeAccountAtom);
|
||||
|
||||
const [value, setValue] = useState('');
|
||||
const profile = JSON.parse(activeAccount.metadata);
|
||||
const profile = destr(activeAccount.metadata);
|
||||
|
||||
const submitEvent = () => {
|
||||
const event: any = {
|
||||
@@ -39,7 +40,7 @@ export default function FormComment({ eventID }: { eventID: any }) {
|
||||
<div>
|
||||
<div className="relative h-11 w-11 shrink-0 overflow-hidden rounded-md border border-white/10">
|
||||
<ImageWithFallback
|
||||
src={profile.picture}
|
||||
src={profile?.picture}
|
||||
alt={activeAccount.id}
|
||||
fill={true}
|
||||
className="rounded-md object-cover"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { NoteContent } from '@components/note/content';
|
||||
import { RootNote } from '@components/note/root';
|
||||
|
||||
import destr from 'destr';
|
||||
@@ -43,8 +42,7 @@ export const Note = memo(function Note({ event }: { event: any }) {
|
||||
onClick={(e) => openThread(e)}
|
||||
className="relative z-10 flex h-min min-h-min w-full select-text flex-col border-b border-zinc-800 py-5 px-3 hover:bg-black/20"
|
||||
>
|
||||
<div>{fetchRootEvent()}</div>
|
||||
<NoteContent data={event} />
|
||||
<p>{event.content}</p>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { NoteContent } from '@components/note/content';
|
||||
import { RelayContext } from '@components/relaysProvider';
|
||||
|
||||
import { relaysAtom } from '@stores/relays';
|
||||
@@ -51,7 +50,7 @@ export const RootNote = memo(function RootNote({ id }: { id: string }) {
|
||||
return (
|
||||
<div className="relative pb-5">
|
||||
<div className="absolute top-0 left-[21px] h-full w-0.5 bg-gradient-to-t from-zinc-800 to-zinc-600"></div>
|
||||
<NoteContent data={event} />
|
||||
<p>{event.content}</p>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user