add empty state for feed page

This commit is contained in:
Ren Amamiya
2023-07-10 08:40:12 +07:00
parent 8d29e521cc
commit df409afeed
3 changed files with 55 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
import { useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { useVirtualizer } from '@tanstack/react-virtual';
import { useEffect, useRef } from 'react';
import { Link } from 'react-router-dom';
import { getNotesByAuthors, removeBlock } from '@libs/storage';
@@ -79,6 +80,16 @@ export function FeedBlock({ params }: { params: any }) {
<NoteSkeleton />
</div>
</div>
) : itemsVirtualizer.length === 0 ? (
<div className="px-3 py-1.5">
<div className="rounded-xl border-t border-zinc-800/50 bg-zinc-900 px-3 py-6">
<div className="flex flex-col items-center gap-4">
<p className="text-center text-sm text-zinc-300">
Not found any posts from last 48 hours
</p>
</div>
</div>
</div>
) : (
<div
className="relative w-full"