diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-22 21:41:05 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-22 21:41:05 +0000 |
| commit | 0aa4760f742471c282186f3b0580e66d2d370588 (patch) | |
| tree | 0e9f111c1403d769ceed88f4f52ebd53c1978412 /packages/web/app/dashboard/bookmarks/components | |
| parent | 600e73eacb9185d5581cc29bcab09f262720532d (diff) | |
| download | karakeep-0aa4760f742471c282186f3b0580e66d2d370588.tar.zst | |
fix: Minor UI tweaks and fixing addition of first bookmark
Diffstat (limited to 'packages/web/app/dashboard/bookmarks/components')
| -rw-r--r-- | packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx | 7 | ||||
| -rw-r--r-- | packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx b/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx index 44495f1f..d704b9d6 100644 --- a/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx +++ b/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx @@ -21,16 +21,11 @@ export default async function Bookmarks({ const bookmarks = await api.bookmarks.getBookmarks(query); - // TODO: This needs to be polished return ( <> <div className="container pb-4 text-2xl">{title}</div> <div className="container"> - {bookmarks.bookmarks.length == 0 ? ( - "No bookmarks" - ) : ( - <BookmarksGrid query={query} bookmarks={bookmarks.bookmarks} /> - )} + <BookmarksGrid query={query} bookmarks={bookmarks.bookmarks} /> </div> </> ); diff --git a/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx b/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx index dc98472e..e07d48b6 100644 --- a/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx +++ b/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx @@ -21,6 +21,9 @@ export default function BookmarksGrid({ const { data } = api.bookmarks.getBookmarks.useQuery(query, { initialData: { bookmarks: initialBookmarks }, }); + if (data.bookmarks.length == 0) { + return <p>No bookmarks</p>; + } return ( <div className="container grid grid-cols-1 gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"> {data.bookmarks.map((b) => renderBookmark(b))} |
