From 3191dfa1958d7e0d4fff9a30b433f6c02fd3a53e Mon Sep 17 00:00:00 2001 From: rayzhou-bit Date: Thu, 9 May 2024 17:14:08 -0700 Subject: [PATCH] minor improvements --- src/assets/icons/library.svg | 4 +-- .../Dropdowns/ActionDropdown.jsx | 1 + .../Dropdowns/ActionDropdown.scss | 7 ++++- .../Dropdowns/ColorDropdown.jsx | 3 +- src/components/Card/LibraryTitle.jsx | 1 + src/components/Card/Title.jsx | 1 + src/components/Card/hooks.js | 4 +-- src/components/Library/FilterBar.jsx | 30 ++++++++++--------- src/components/Library/hooks.js | 2 +- src/components/Library/index.jsx | 4 +-- src/components/Library/index.scss | 7 +++++ 11 files changed, 41 insertions(+), 23 deletions(-) diff --git a/src/assets/icons/library.svg b/src/assets/icons/library.svg index 8c8a331..0204fb7 100644 --- a/src/assets/icons/library.svg +++ b/src/assets/icons/library.svg @@ -1,3 +1,3 @@ - - + + diff --git a/src/components-shared/Dropdowns/ActionDropdown.jsx b/src/components-shared/Dropdowns/ActionDropdown.jsx index 6c24b70..b59399d 100644 --- a/src/components-shared/Dropdowns/ActionDropdown.jsx +++ b/src/components-shared/Dropdowns/ActionDropdown.jsx @@ -15,6 +15,7 @@ import useOutsideClick from '../../utils/useOutsideClick'; export const ACTION_TYPE = { danger: 'danger', + bold: 'bold', disabled: 'disabled', }; diff --git a/src/components-shared/Dropdowns/ActionDropdown.scss b/src/components-shared/Dropdowns/ActionDropdown.scss index 81c5957..8efea34 100644 --- a/src/components-shared/Dropdowns/ActionDropdown.scss +++ b/src/components-shared/Dropdowns/ActionDropdown.scss @@ -66,11 +66,16 @@ $y: 38px; border: 1px solid #f4f4f4; } + +// ACTION_TYPES .danger { font-weight: 600 !important; color: #ed5e31 !important; } - +.bold { + font-weight: 700 !important; + color: #353535 !important; +} .disabled { color: #C4C4C4 !important; } diff --git a/src/components-shared/Dropdowns/ColorDropdown.jsx b/src/components-shared/Dropdowns/ColorDropdown.jsx index 7339204..27979a1 100644 --- a/src/components-shared/Dropdowns/ColorDropdown.jsx +++ b/src/components-shared/Dropdowns/ColorDropdown.jsx @@ -8,6 +8,7 @@ import useOutsideClick from '../../utils/useOutsideClick'; export const ColorDropdown = ({ btnRef, isOpen, + message, onClose, onUpdateColor, selectedColor, @@ -39,7 +40,7 @@ export const ColorDropdown = ({ className='color-dropdown' ref={dropdownRef} > -
Select card top color
+
{message}
{ colorList }
diff --git a/src/components/Card/LibraryTitle.jsx b/src/components/Card/LibraryTitle.jsx index f9c4cf7..bd8e89e 100644 --- a/src/components/Card/LibraryTitle.jsx +++ b/src/components/Card/LibraryTitle.jsx @@ -80,6 +80,7 @@ const LibraryTitle = ({ dispatch(actions.project.copyCard({ id: cardId })), }, - {}, { title: 'Rename', callback: () => beginTitleEdit(), @@ -280,7 +279,8 @@ export const useOptionsDropdownHooks = ({ // callback: () => {}, // }, { - title: 'Remove from tab', + title: 'Move to the library', + type: ACTION_TYPE.bold, callback: () => dispatch(actions.project.unlinkCardFromView({ id: cardId })), icon: LibraryIcon, }, diff --git a/src/components/Library/FilterBar.jsx b/src/components/Library/FilterBar.jsx index 0292e41..580ddd6 100644 --- a/src/components/Library/FilterBar.jsx +++ b/src/components/Library/FilterBar.jsx @@ -24,18 +24,6 @@ const FilterBar = ({ Filter
- -
+
+ +
diff --git a/src/components/Library/hooks.js b/src/components/Library/hooks.js index 0b8c9b1..f7c7432 100644 --- a/src/components/Library/hooks.js +++ b/src/components/Library/hooks.js @@ -87,7 +87,7 @@ export const useLibraryHooks = () => { const [ isOpen, setIsOpen ] = useState(false); const [ searchString, setSearchString ] = useState(''); const [ filterOption, setFilterOption ] = useState(FILTER_OPTIONS.all); - const [ filterColor, setFilterColor ] = useState(null); + const [ filterColor, setFilterColor ] = useState(''); const [ sortOption, setSortOption ] = useState(SORT_OPTIONS.abc); const [ viewOption, setViewOption ] = useState(VIEW_OPTIONS.condensed); diff --git a/src/components/Library/index.jsx b/src/components/Library/index.jsx index b421b0f..5623969 100644 --- a/src/components/Library/index.jsx +++ b/src/components/Library/index.jsx @@ -47,11 +47,11 @@ const Library = () => { {cardComponents} - + {/* */} ); diff --git a/src/components/Library/index.scss b/src/components/Library/index.scss index 343b5b2..3f81324 100644 --- a/src/components/Library/index.scss +++ b/src/components/Library/index.scss @@ -45,6 +45,7 @@ $library-width: 35vw; .tooltip { top: 30%; right: 115%; + white-space: nowrap; } .tooltip::after { top: 50%; @@ -109,6 +110,12 @@ $library-width: 35vw; right: 0; } } + + .divider { + height: 25px; + margin: auto 10px; + border: 1px solid black; + } } }