diff options
| author | MohamedBassem <me@mbassem.com> | 2024-04-23 20:11:25 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-04-23 20:11:25 +0100 |
| commit | 88b92d8eb2a203f7092314a5d9c9a7070b568b6d (patch) | |
| tree | eb8de4a1118d37f4aac3ccd93a0a0df97d415f71 /apps/web/components/dashboard/lists | |
| parent | c1baada542c1970813b46a232ff930aff1b5bad2 (diff) | |
| download | karakeep-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.tsx | 7 |
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> |
