diff --git a/frontend/web/src/components/ShortcutsNavigator.tsx b/frontend/web/src/components/ShortcutsNavigator.tsx index b61c701..58df272 100644 --- a/frontend/web/src/components/ShortcutsNavigator.tsx +++ b/frontend/web/src/components/ShortcutsNavigator.tsx @@ -18,7 +18,7 @@ const ShortcutsNavigator = () => { className={classNames( "flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md", currentTab === "tab:all" - ? "bg-gray-600 dark:bg-zinc-700 text-white dark:text-gray-400 shadow" + ? "bg-blue-700 dark:bg-blue-800 text-white dark:text-gray-400 shadow" : "hover:bg-gray-200 dark:hover:bg-zinc-700" )} onClick={() => viewStore.setFilter({ tab: "tab:all" })} @@ -30,7 +30,7 @@ const ShortcutsNavigator = () => { className={classNames( "flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md", currentTab === "tab:mine" - ? "bg-gray-600 dark:bg-zinc-700 text-white dark:text-gray-400 shadow" + ? "bg-blue-700 dark:bg-blue-800 text-white dark:text-gray-400 shadow" : "hover:bg-gray-200 dark:hover:bg-zinc-700" )} onClick={() => viewStore.setFilter({ tab: "tab:mine" })} @@ -44,7 +44,7 @@ const ShortcutsNavigator = () => { className={classNames( "flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md", currentTab === `tag:${tag}` - ? "bg-gray-600 dark:bg-zinc-700 text-white dark:text-gray-400 shadow" + ? "bg-blue-700 dark:bg-blue-800 text-white dark:text-gray-400 shadow" : "hover:bg-gray-200 dark:hover:bg-zinc-700" )} onClick={() => viewStore.setFilter({ tab: `tag:${tag}`, tag: undefined })} diff --git a/frontend/web/src/pages/CollectionDashboard.tsx b/frontend/web/src/pages/CollectionDashboard.tsx index 1ad6081..686bba9 100644 --- a/frontend/web/src/pages/CollectionDashboard.tsx +++ b/frontend/web/src/pages/CollectionDashboard.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mui/joy"; +import { Button, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import CollectionView from "@/components/CollectionView"; @@ -17,10 +17,17 @@ const CollectionDashboard: React.FC = () => { const { t } = useTranslation(); const loadingState = useLoading(); const collectionStore = useCollectionStore(); - const collections = collectionStore.getCollectionList(); const [state, setState] = useState({ showCreateCollectionDrawer: false, }); + const [search, setSearch] = useState(""); + const filteredCollections = collectionStore.getCollectionList().filter((collection) => { + return ( + collection.name.toLowerCase().includes(search.toLowerCase()) || + collection.title.toLowerCase().includes(search.toLowerCase()) || + collection.description.toLowerCase().includes(search.toLowerCase()) + ); + }); useEffect(() => { Promise.all([shortcutService.getMyAllShortcuts(), collectionStore.fetchCollectionList()]).finally(() => { @@ -52,7 +59,17 @@ const CollectionDashboard: React.FC = () => {
-
+
+ } + value={search} + onChange={(e) => setSearch(e.target.value)} + /> +
- ) : collections.length === 0 ? ( + ) : filteredCollections.length === 0 ? (

No collections found.

) : (
- {collections.map((collection) => { + {filteredCollections.map((collection) => { return ; })}