chore: clean up

This commit is contained in:
2024-11-01 13:14:47 +07:00
parent d37e2a3c80
commit 6ad8ffddf0
4 changed files with 35 additions and 18 deletions

View File

@@ -21,13 +21,15 @@ export const RepostNote = memo(function RepostNote({
{isLoading ? ( {isLoading ? (
<div className="flex items-center justify-center h-20 gap-2"> <div className="flex items-center justify-center h-20 gap-2">
<Spinner /> <Spinner />
<span className="text-sm font-medium text-neutral-700 dark:text-neutral-300"> <p className="text-sm font-medium text-neutral-700 dark:text-neutral-300">
Loading event... Loading event...
</span> </p>
</div> </div>
) : isError || !data ? ( ) : isError || !data ? (
<div className="flex items-center justify-center h-20"> <div className="flex items-center justify-center h-20">
Event not found within your current relay set <p className="text-sm">
Repost event not found within your current relay set
</p>
</div> </div>
) : ( ) : (
<Note.Provider event={data}> <Note.Provider event={data}>

View File

@@ -136,17 +136,22 @@ function Screen() {
<ScrollArea.Viewport ref={ref} className="relative h-full px-3 pb-3"> <ScrollArea.Viewport ref={ref} className="relative h-full px-3 pb-3">
<Virtualizer scrollRef={ref as unknown as RefObject<HTMLElement>}> <Virtualizer scrollRef={ref as unknown as RefObject<HTMLElement>}>
{isLoading ? ( {isLoading ? (
<div className="inline-flex items-center gap-1.5"> <div className="flex items-center justify-center h-20 gap-2">
<Spinner className="size-4" /> <Spinner />
Loading... <p className="text-sm font-medium text-neutral-700 dark:text-neutral-300">
Loading event...
</p>
</div> </div>
) : isError ? ( ) : isError ? (
<div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50"> <div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50">
<p className="text-center">{error?.message ?? "Error"}</p> <p className="text-sm text-center">{error?.message ?? "Error"}</p>
</div> </div>
) : !data?.length ? ( ) : !data?.length ? (
<div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50"> <div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50">
<p className="text-center">Empty.</p> <p className="text-sm text-center">
Nothing to show yet, you can use Lume more and comeback lack to
see new events.
</p>
</div> </div>
) : ( ) : (
data?.map((item) => renderItem(item)) data?.map((item) => renderItem(item))

View File

@@ -138,17 +138,22 @@ function Screen() {
<ScrollArea.Viewport ref={ref} className="relative h-full px-3 pb-3"> <ScrollArea.Viewport ref={ref} className="relative h-full px-3 pb-3">
<Virtualizer scrollRef={ref as unknown as RefObject<HTMLElement>}> <Virtualizer scrollRef={ref as unknown as RefObject<HTMLElement>}>
{isLoading ? ( {isLoading ? (
<div className="inline-flex items-center gap-1.5"> <div className="flex items-center justify-center h-20 gap-2">
<Spinner className="size-4" /> <Spinner />
Loading... <p className="text-sm font-medium text-neutral-700 dark:text-neutral-300">
Loading event...
</p>
</div> </div>
) : isError ? ( ) : isError ? (
<div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50"> <div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50">
<p className="text-center">{error?.message ?? "Error"}</p> <p className="text-sm text-center">{error?.message ?? "Error"}</p>
</div> </div>
) : !data?.length ? ( ) : !data?.length ? (
<div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50"> <div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50">
<p className="text-center">Empty.</p> <p className="text-sm text-center">
Nothing to show yet, you can use Lume more and comeback lack to
see new events.
</p>
</div> </div>
) : ( ) : (
data?.map((item) => renderItem(item)) data?.map((item) => renderItem(item))

View File

@@ -108,17 +108,22 @@ function Screen() {
<ScrollArea.Viewport ref={ref} className="relative h-full px-3 pb-3"> <ScrollArea.Viewport ref={ref} className="relative h-full px-3 pb-3">
<Virtualizer scrollRef={ref as unknown as RefObject<HTMLElement>}> <Virtualizer scrollRef={ref as unknown as RefObject<HTMLElement>}>
{isLoading ? ( {isLoading ? (
<div className="inline-flex items-center gap-1.5"> <div className="flex items-center justify-center h-20 gap-2">
<Spinner className="size-4" /> <Spinner />
Loading... <p className="text-sm font-medium text-neutral-700 dark:text-neutral-300">
Loading event...
</p>
</div> </div>
) : isError ? ( ) : isError ? (
<div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50"> <div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50">
<p className="text-center">{error?.message ?? "Error"}</p> <p className="text-sm text-center">{error?.message ?? "Error"}</p>
</div> </div>
) : !data?.length ? ( ) : !data?.length ? (
<div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50"> <div className="mb-3 flex flex-col items-center justify-center h-16 w-full rounded-xl overflow-hidden bg-neutral-200/50 dark:bg-neutral-800/50">
<p className="text-center">Empty.</p> <p className="text-sm text-center">
Nothing to show yet, you can use Lume more and comeback lack to
see new events.
</p>
</div> </div>
) : ( ) : (
data?.map((item) => renderItem(item)) data?.map((item) => renderItem(item))