Skip to content

Commit

Permalink
minor improvements (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzhou-bit authored May 10, 2024
1 parent 4a99847 commit fcd9f1f
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/assets/icons/library.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components-shared/Dropdowns/ActionDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useOutsideClick from '../../utils/useOutsideClick';

export const ACTION_TYPE = {
danger: 'danger',
bold: 'bold',
disabled: 'disabled',
};

Expand Down
7 changes: 6 additions & 1 deletion src/components-shared/Dropdowns/ActionDropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 2 additions & 1 deletion src/components-shared/Dropdowns/ColorDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import useOutsideClick from '../../utils/useOutsideClick';
export const ColorDropdown = ({
btnRef,
isOpen,
message,
onClose,
onUpdateColor,
selectedColor,
Expand Down Expand Up @@ -39,7 +40,7 @@ export const ColorDropdown = ({
className='color-dropdown'
ref={dropdownRef}
>
<div className='select-text'>Select card top color</div>
<div className='select-text'>{message}</div>
<div className='container'>
{ colorList }
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/Card/LibraryTitle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const LibraryTitle = ({
<ColorDropdown
btnRef={colorDropdownBtnRef}
isOpen={isColorDropdownOpen}
message="Select card-top color"
onClose={closeColorDropdown}
onUpdateColor={updateColor}
selectedColor={color}
Expand Down
1 change: 1 addition & 0 deletions src/components/Card/Title.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const Title = ({
<ColorDropdown
btnRef={colorDropdownBtnRef}
isOpen={isColorDropdownOpen}
message="Select card-top color"
onClose={closeColorDropdown}
onUpdateColor={updateColor}
selectedColor={color}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Card/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ export const useOptionsDropdownHooks = ({
title: 'Duplicate card',
callback: () => dispatch(actions.project.copyCard({ id: cardId })),
},
{},
{
title: 'Rename',
callback: () => beginTitleEdit(),
Expand All @@ -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,
},
Expand Down
30 changes: 16 additions & 14 deletions src/components/Library/FilterBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ const FilterBar = ({
<span>Filter</span>
</div>
<div className='selections'>
<button
className={`option ${filterOption === FILTER_OPTIONS.thisTab ? 'selected' : null}`}
onClick={() => setFilterOption(FILTER_OPTIONS.thisTab)}
>
<span>Cards in this Tab</span>
</button>
<button
className={`option ${filterOption === FILTER_OPTIONS.all ? 'selected' : null}`}
onClick={() => setFilterOption(FILTER_OPTIONS.all)}
>
<span>All Cards</span>
</button>
<div className='color-selection'>
<button
className={`option ${filterOption === FILTER_OPTIONS.color ? 'selected' : null}`}
Expand All @@ -46,17 +34,31 @@ const FilterBar = ({
</button>
<ColorDropdown
btnRef={colorDropdownBtnRef}
selectedColor={filterColor}
isOpen={isColorDropdownOpen}
message="Filter by card color"
onClose={closeColorDropdown}
onUpdateColor={setFilterColor}
selectedColor={filterColor}
/>
</div>
<div className='divider' />
<button
className={`option ${filterOption === FILTER_OPTIONS.thisTab ? 'selected' : null}`}
onClick={() => setFilterOption(FILTER_OPTIONS.thisTab)}
>
<span>In this tab</span>
</button>
<button
className={`option ${filterOption === FILTER_OPTIONS.all ? 'selected' : null}`}
onClick={() => setFilterOption(FILTER_OPTIONS.all)}
>
<span>In all tabs</span>
</button>
<button
className={`option ${filterOption === FILTER_OPTIONS.unsorted ? 'selected' : null}`}
onClick={() => setFilterOption(FILTER_OPTIONS.unsorted)}
>
<span>Unsorted</span>
<span>In no tabs</span>
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Library/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/components/Library/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ const Library = () => {
{cardComponents}
</div>

<LibrarySearch />
{/* <LibrarySearch /> */}
</div>
<button className='library-btn' onClick={toggleLibrary}>
<img src={LibraryIcon} alt='Library' />
<span className='tooltip'>Library</span>
<span className='tooltip'>Library of cards</span>
</button>
</div>
);
Expand Down
7 changes: 7 additions & 0 deletions src/components/Library/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $library-width: 35vw;
.tooltip {
top: 30%;
right: 115%;
white-space: nowrap;
}
.tooltip::after {
top: 50%;
Expand Down Expand Up @@ -109,6 +110,12 @@ $library-width: 35vw;
right: 0;
}
}

.divider {
height: 25px;
margin: auto 10px;
border: 1px solid black;
}
}
}

Expand Down

0 comments on commit fcd9f1f

Please sign in to comment.