A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
feat: add a notification badge for list invitations
Mohamed Bassem3c6b8e97be4a
diff --git a/apps/web/components/dashboard/sidebar/AllLists.tsx b/apps/web/components/dashboard/sidebar/AllLists.tsxindex f8b80cba..306bf4b4 100644--- a/apps/web/components/dashboard/sidebar/AllLists.tsx+++ b/apps/web/components/dashboard/sidebar/AllLists.tsx@@ -24,6 +24,7 @@ import { ZBookmarkListTreeNode } from "@karakeep/shared/utils/listUtils";import { CollapsibleBookmarkLists } from "../lists/CollapsibleBookmarkLists";import { EditListModal } from "../lists/EditListModal";import { ListOptions } from "../lists/ListOptions";+import { InvitationNotificationBadge } from "./InvitationNotificationBadge";export default function AllLists({initialData,@@ -90,6 +91,7 @@ export default function AllLists({path={`/dashboard/lists`}linkClassName="py-0.5"className="px-0.5"+ right={<InvitationNotificationBadge />}/><SidebarItemlogo={<span className="text-lg">⭐️</span>}diff --git a/apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx b/apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsxnew file mode 100644index 00000000..e4d7b39f--- /dev/null+++ b/apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx@@ -0,0 +1,25 @@+"use client";++import { api } from "@/lib/trpc";++export function InvitationNotificationBadge() {+ const { data: pendingInvitations } = api.lists.getPendingInvitations.useQuery(+ undefined,+ {+ refetchInterval: 1000 * 60 * 5,+ },+ );+ const pendingInvitationsCount = pendingInvitations?.length ?? 0;++ if (pendingInvitationsCount === 0) {+ return null;+ }++ return (+ <div className="flex items-center px-1">+ <span className="rounded-full bg-blue-500 px-2 py-0.5 text-center text-xs text-white">+ {pendingInvitationsCount}+ </span>+ </div>+ );+}