From 21fd0ca8655667868fe09b0c69c55d8863e14e1c Mon Sep 17 00:00:00 2001 From: rayzhou-bit Date: Fri, 10 May 2024 04:04:16 -0700 Subject: [PATCH] view options --- src/assets/icons/condense-disabled.svg | 18 ++++++ src/assets/icons/condense-enabled.svg | 18 ++++++ src/assets/icons/expand-disabled.svg | 18 ++++++ src/assets/icons/expand-enabled.svg | 18 ++++++ .../Dropdowns/ActionDropdown.jsx | 2 +- src/components/Card/LibraryCard.jsx | 8 ++- src/components/Card/LibraryContent.jsx | 5 +- src/components/Library/FilterBar.jsx | 36 ++++++----- src/components/Library/ViewBar.jsx | 60 +++++++++++++++++++ src/components/Library/hooks.js | 45 +++++++++----- src/components/Library/index.jsx | 24 +++++--- src/components/Library/index.scss | 46 ++++++++++++-- 12 files changed, 247 insertions(+), 51 deletions(-) create mode 100644 src/assets/icons/condense-disabled.svg create mode 100644 src/assets/icons/condense-enabled.svg create mode 100644 src/assets/icons/expand-disabled.svg create mode 100644 src/assets/icons/expand-enabled.svg create mode 100644 src/components/Library/ViewBar.jsx diff --git a/src/assets/icons/condense-disabled.svg b/src/assets/icons/condense-disabled.svg new file mode 100644 index 0000000..ae36e56 --- /dev/null +++ b/src/assets/icons/condense-disabled.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/condense-enabled.svg b/src/assets/icons/condense-enabled.svg new file mode 100644 index 0000000..ed11fb0 --- /dev/null +++ b/src/assets/icons/condense-enabled.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/expand-disabled.svg b/src/assets/icons/expand-disabled.svg new file mode 100644 index 0000000..a2282f3 --- /dev/null +++ b/src/assets/icons/expand-disabled.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/expand-enabled.svg b/src/assets/icons/expand-enabled.svg new file mode 100644 index 0000000..a04eae7 --- /dev/null +++ b/src/assets/icons/expand-enabled.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/components-shared/Dropdowns/ActionDropdown.jsx b/src/components-shared/Dropdowns/ActionDropdown.jsx index b59399d..61457f5 100644 --- a/src/components-shared/Dropdowns/ActionDropdown.jsx +++ b/src/components-shared/Dropdowns/ActionDropdown.jsx @@ -6,7 +6,7 @@ import useOutsideClick from '../../utils/useOutsideClick'; /* Each item in the items array should be similar to the following object: { - title: 'Move to unsorted', + title: 'Move to library', type: ACTION_TYPE.danger, callback: () => dispatch(actions.project.unlinkCardFromView({ id: cardId })), icon: LibraryIcon, diff --git a/src/components/Card/LibraryCard.jsx b/src/components/Card/LibraryCard.jsx index b690c2d..7951b22 100644 --- a/src/components/Card/LibraryCard.jsx +++ b/src/components/Card/LibraryCard.jsx @@ -7,7 +7,10 @@ import LibraryContent from './LibraryContent'; import './LibraryCard.scss'; -const LibraryCard = ({ cardId }) => { +const LibraryCard = ({ + cardId, + isExpanded, +}) => { const { libraryCardRef, isActive, @@ -20,7 +23,7 @@ const LibraryCard = ({ cardId }) => { onAnimationEnd, onClick, } = useLibraryCardHooks({ - cardId + cardId, }); return ( @@ -42,6 +45,7 @@ const LibraryCard = ({ cardId }) => { {/* */} diff --git a/src/components/Card/LibraryContent.jsx b/src/components/Card/LibraryContent.jsx index 272bd59..d894bb8 100644 --- a/src/components/Card/LibraryContent.jsx +++ b/src/components/Card/LibraryContent.jsx @@ -6,6 +6,7 @@ import './LibraryCard.scss'; const LibraryContent = ({ cardId, + isExpanded, isSelected, setEditingCard, }) => { @@ -36,10 +37,10 @@ const LibraryContent = ({ return (