Skip to content

Commit

Permalink
Switched current Sort Button with same used for filters and options o…
Browse files Browse the repository at this point in the history
…nes (twentyhq#5764)

I changed the Sort button used in the Header using
StyledHeaderDropdownButton component (the same used for Filter and
Options') instead of LightButton.
This PR aims to fix the issue: twentyhq#5743

---------

Co-authored-by: Félix Malfait <[email protected]>
  • Loading branch information
RobertoSimonini1 and FelixMalfait authored Jun 7, 2024
1 parent 58c904c commit b605708
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.DS_Store
/.idea
**/**/node_modules/
.cache

# yarn is the recommended package manager across the project
**/**/.package-lock.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { IconChevronDown, useIcons } from 'twenty-ui';
import { OBJECT_SORT_DROPDOWN_ID } from '@/object-record/object-sort-dropdown/constants/ObjectSortDropdownId';
import { useObjectSortDropdown } from '@/object-record/object-sort-dropdown/hooks/useObjectSortDropdown';
import { ObjectSortDropdownScope } from '@/object-record/object-sort-dropdown/scopes/ObjectSortDropdownScope';
import { LightButton } from '@/ui/input/button/components/LightButton';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { StyledHeaderDropdownButton } from '@/ui/layout/dropdown/components/StyledHeaderDropdownButton';
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';

Expand Down Expand Up @@ -54,14 +55,15 @@ export const ObjectSortDropdownButton = ({
setSelectedSortDirection,
toggleSortDropdown,
resetState,
isSortSelected,
availableSortDefinitions,
handleAddSort,
objectSortDropdownSearchInputState,
setObjectSortDropdownSearchInput,
resetSearchInput,
} = useObjectSortDropdown();

const { isDropdownOpen } = useDropdown(OBJECT_SORT_DROPDOWN_ID);

const handleButtonClick = () => {
toggleSortDropdown();
};
Expand All @@ -84,11 +86,12 @@ export const ObjectSortDropdownButton = ({
dropdownHotkeyScope={hotkeyScope}
dropdownOffset={{ y: 8 }}
clickableComponent={
<LightButton
title="Sort"
active={isSortSelected}
<StyledHeaderDropdownButton
isUnfolded={isDropdownOpen}
onClick={handleButtonClick}
/>
>
Sort
</StyledHeaderDropdownButton>
}
dropdownComponents={
<>
Expand Down

0 comments on commit b605708

Please sign in to comment.