update space screen

This commit is contained in:
Ren Amamiya
2023-08-22 09:10:04 +07:00
parent 917e49b25d
commit 4830f0b236
33 changed files with 766 additions and 255 deletions
+13 -4
View File
@@ -8,8 +8,7 @@ import { useStorage } from '@libs/storage/provider';
import { LoaderIcon } from '@shared/icons';
import { MiniUser } from '@shared/notes/users/mini';
import { widgetKinds } from '@stores/constants';
import { useWidgets } from '@stores/widgets';
import { WidgetKinds, useWidgets } from '@stores/widgets';
import { compactNumber } from '@utils/number';
@@ -54,7 +53,11 @@ export function NoteMetadata({ id }: { id: string }) {
return { replies, users, zap };
},
{ refetchOnWindowFocus: false, refetchOnReconnect: false, refetchOnMount: false }
{
enabled: !!ndk,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
}
);
if (status === 'loading') {
@@ -68,6 +71,12 @@ export function NoteMetadata({ id }: { id: string }) {
);
}
if (status === 'error') {
<div>
<div className="pb-3" />
</div>;
}
return (
<div>
{data.replies > 0 ? (
@@ -86,7 +95,7 @@ export function NoteMetadata({ id }: { id: string }) {
type="button"
onClick={() =>
setWidget(db, {
kind: widgetKinds.thread,
kind: WidgetKinds.thread,
title: 'Thread',
content: id,
})