From 613dd39aba0e51e74ac2db3b6842e8c683c6353f Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 25 Jun 2024 09:11:15 +0800 Subject: [PATCH 1/8] Filtering on the library view --- .../patterns/LibraryCards/LibraryGridCard.tsx | 1 + .../LibraryCards/LibraryHoverActions.tsx | 61 +++++++++++++------ .../templates/library/LibraryContainer.tsx | 26 ++++---- .../library/LibraryItemsContainer.tsx | 24 ++++---- .../web/lib/hooks/useLibraryItemActions.tsx | 13 ++-- .../networking/fragments/articleFragment.ts | 2 + .../queries/useGetLibraryItemsQuery.tsx | 50 ++++++--------- packages/web/pages/l/[section].tsx | 41 +++++++++++-- 8 files changed, 131 insertions(+), 87 deletions(-) diff --git a/packages/web/components/patterns/LibraryCards/LibraryGridCard.tsx b/packages/web/components/patterns/LibraryCards/LibraryGridCard.tsx index 8bba60f0b..f8b1fe399 100644 --- a/packages/web/components/patterns/LibraryCards/LibraryGridCard.tsx +++ b/packages/web/components/patterns/LibraryCards/LibraryGridCard.tsx @@ -65,6 +65,7 @@ export function LibraryGridCard(props: LinkedItemCardProps): JSX.Element { pl: '0px', padding: '0px', width: '100%', + maxWidth: '400px', height: '100%', minHeight: '270px', borderRadius: '5px', diff --git a/packages/web/components/patterns/LibraryCards/LibraryHoverActions.tsx b/packages/web/components/patterns/LibraryCards/LibraryHoverActions.tsx index d0229c019..28ad8382b 100644 --- a/packages/web/components/patterns/LibraryCards/LibraryHoverActions.tsx +++ b/packages/web/components/patterns/LibraryCards/LibraryHoverActions.tsx @@ -13,6 +13,9 @@ import { TrashIcon } from '../../elements/icons/TrashIcon' import { LabelIcon } from '../../elements/icons/LabelIcon' import { UnarchiveIcon } from '../../elements/icons/UnarchiveIcon' import { BrowserIcon } from '../../elements/icons/BrowserIcon' +import { LibraryIcon } from '../../elements/icons/LibraryIcon' +import useLibraryItemActions from '../../../lib/hooks/useLibraryItemActions' +import { MoveToInboxIcon } from '../../elements/icons/MoveToInboxIcon' type LibraryHoverActionsProps = { viewer: UserBasicData @@ -25,6 +28,7 @@ type LibraryHoverActionsProps = { export const LibraryHoverActions = (props: LibraryHoverActionsProps) => { const [menuOpen, setMenuOpen] = useState(false) + const { moveItem } = useLibraryItemActions() return ( { color={theme.colors.thNotebookSubtle.toString()} /> - + + ) : ( + + )}