aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/lists
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-04-23 20:11:25 +0100
committerMohamedBassem <me@mbassem.com>2024-04-23 20:11:25 +0100
commit88b92d8eb2a203f7092314a5d9c9a7070b568b6d (patch)
treeeb8de4a1118d37f4aac3ccd93a0a0df97d415f71 /apps/web/components/dashboard/lists
parentc1baada542c1970813b46a232ff930aff1b5bad2 (diff)
downloadkarakeep-88b92d8eb2a203f7092314a5d9c9a7070b568b6d.tar.zst
feature(web): Change the AddList modal to allow adding and removing bookmarks from lists
Diffstat (limited to 'apps/web/components/dashboard/lists')
-rw-r--r--apps/web/components/dashboard/lists/BookmarkListSelector.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/web/components/dashboard/lists/BookmarkListSelector.tsx b/apps/web/components/dashboard/lists/BookmarkListSelector.tsx
index fdae1c17..144297cf 100644
--- a/apps/web/components/dashboard/lists/BookmarkListSelector.tsx
+++ b/apps/web/components/dashboard/lists/BookmarkListSelector.tsx
@@ -14,12 +14,14 @@ export function BookmarkListSelector({
value,
onChange,
hideSubtreeOf,
+ hideBookmarkIds = [],
placeholder = "Select a list",
}: {
value?: string | null;
onChange: (value: string) => void;
placeholder?: string;
hideSubtreeOf?: string;
+ hideBookmarkIds?: string[];
}) {
const { data, isPending: isFetchingListsPending } = useBookmarkLists();
let { allPaths } = data ?? {};
@@ -29,6 +31,9 @@ export function BookmarkListSelector({
}
allPaths = allPaths?.filter((path) => {
+ if (hideBookmarkIds.includes(path[path.length - 1].id)) {
+ return false;
+ }
if (!hideSubtreeOf) {
return true;
}
@@ -36,7 +41,7 @@ export function BookmarkListSelector({
});
return (
- <Select onValueChange={onChange} value={value ?? undefined}>
+ <Select onValueChange={onChange} value={value ?? ""}>
<SelectTrigger className="w-full">
<SelectValue placeholder={placeholder} />
</SelectTrigger>