From 03faa429f9342b4b5aa15d870b4e86ee5bf41650 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Wed, 20 Mar 2024 18:26:59 +0000 Subject: fix(web): Greatly improve the search feeling by removing the flicker --- apps/web/app/dashboard/archive/page.tsx | 6 ++++- apps/web/app/dashboard/bookmarks/page.tsx | 8 ++++++- apps/web/app/dashboard/favourites/page.tsx | 5 ++-- apps/web/app/dashboard/lists/[listId]/page.tsx | 32 +++++++++++--------------- apps/web/app/dashboard/search/page.tsx | 9 +------- apps/web/app/dashboard/tags/[tagName]/page.tsx | 19 ++++++--------- 6 files changed, 35 insertions(+), 44 deletions(-) (limited to 'apps/web/app') diff --git a/apps/web/app/dashboard/archive/page.tsx b/apps/web/app/dashboard/archive/page.tsx index 69559185..bc6971db 100644 --- a/apps/web/app/dashboard/archive/page.tsx +++ b/apps/web/app/dashboard/archive/page.tsx @@ -3,7 +3,11 @@ import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; export default async function ArchivedBookmarkPage() { return (
- + 🗄️ Archive

} + query={{ archived: true }} + showDivider={true} + />
); } diff --git a/apps/web/app/dashboard/bookmarks/page.tsx b/apps/web/app/dashboard/bookmarks/page.tsx index e310df01..02964482 100644 --- a/apps/web/app/dashboard/bookmarks/page.tsx +++ b/apps/web/app/dashboard/bookmarks/page.tsx @@ -1,5 +1,11 @@ import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; export default async function BookmarksPage() { - return ; + return ( + Bookmarks

} + query={{ archived: false }} + showEditorCard={true} + /> + ); } diff --git a/apps/web/app/dashboard/favourites/page.tsx b/apps/web/app/dashboard/favourites/page.tsx index de17461d..310117b1 100644 --- a/apps/web/app/dashboard/favourites/page.tsx +++ b/apps/web/app/dashboard/favourites/page.tsx @@ -4,9 +4,8 @@ export default async function FavouritesBookmarkPage() { return (
⭐️ Favourites

} + query={{ favourited: true, archived: false }} showDivider={true} />
diff --git a/apps/web/app/dashboard/lists/[listId]/page.tsx b/apps/web/app/dashboard/lists/[listId]/page.tsx index a8ba4feb..f28d94b1 100644 --- a/apps/web/app/dashboard/lists/[listId]/page.tsx +++ b/apps/web/app/dashboard/lists/[listId]/page.tsx @@ -1,5 +1,5 @@ import { notFound, redirect } from "next/navigation"; -import BookmarksGrid from "@/components/dashboard/bookmarks/BookmarksGrid"; +import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; import DeleteListButton from "@/components/dashboard/lists/DeleteListButton"; import { api } from "@/server/api/client"; import { getServerAuthSession } from "@/server/auth"; @@ -27,24 +27,18 @@ export default async function ListPage({ throw e; } - const bookmarks = await api.bookmarks.getBookmarks({ - listId: list.id, - archived: false, - }); - return ( -
-
- - {list.icon} {list.name} - - -
-
- -
+ + + {list.icon} {list.name} + + + + } + /> ); } diff --git a/apps/web/app/dashboard/search/page.tsx b/apps/web/app/dashboard/search/page.tsx index 76d23af2..26b984a7 100644 --- a/apps/web/app/dashboard/search/page.tsx +++ b/apps/web/app/dashboard/search/page.tsx @@ -17,14 +17,7 @@ function SearchComp() {

- {data ? ( - b.id) }} - bookmarks={data} - /> - ) : ( - - )} + {data ? : }
); } diff --git a/apps/web/app/dashboard/tags/[tagName]/page.tsx b/apps/web/app/dashboard/tags/[tagName]/page.tsx index f06062c3..326d550e 100644 --- a/apps/web/app/dashboard/tags/[tagName]/page.tsx +++ b/apps/web/app/dashboard/tags/[tagName]/page.tsx @@ -1,5 +1,5 @@ import { notFound, redirect } from "next/navigation"; -import BookmarksGrid from "@/components/dashboard/bookmarks/BookmarksGrid"; +import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; import { api } from "@/server/api/client"; import { getServerAuthSession } from "@/server/auth"; import { TRPCError } from "@trpc/server"; @@ -27,18 +27,13 @@ export default async function TagPage({ throw e; } - const query = { - archived: false, - tagId: tag.id, - }; - - const bookmarks = await api.bookmarks.getBookmarks(query); - return ( -
- {tagName} -
- +
+ {tagName}

} + query={{ archived: false, tagId: tag.id }} + showEditorCard={true} + />
); } -- cgit v1.2.3-70-g09d2