From 910ef626422b82aeac1682cf81bc186022276ae0 Mon Sep 17 00:00:00 2001 From: RobertoSimonini1 Date: Thu, 6 Jun 2024 16:25:26 +0200 Subject: [PATCH 1/2] Switched current Sort Button with same used for filters and options ones --- .../components/ObjectSortDropdownButton.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx b/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx index 02ca431845e5..3cd8c7435fec 100644 --- a/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx +++ b/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx @@ -3,7 +3,6 @@ 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'; @@ -12,6 +11,8 @@ import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem'; import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope'; import { SORT_DIRECTIONS } from '../types/SortDirection'; +import { StyledHeaderDropdownButton } from '@/ui/layout/dropdown/components/StyledHeaderDropdownButton'; +import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown'; export type ObjectSortDropdownButtonProps = { sortDropdownId: string; @@ -29,11 +30,12 @@ export const ObjectSortDropdownButton = ({ setSelectedSortDirection, toggleSortDropdown, resetState, - isSortSelected, availableSortDefinitions, handleAddSort, } = useObjectSortDropdown(); + const {isDropdownOpen} = useDropdown(OBJECT_SORT_DROPDOWN_ID); + const handleButtonClick = () => { toggleSortDropdown(); }; @@ -51,11 +53,12 @@ export const ObjectSortDropdownButton = ({ dropdownHotkeyScope={hotkeyScope} dropdownOffset={{ y: 8 }} clickableComponent={ - + > + Sort + } dropdownComponents={ <> From 625bcc8dc557ef007915d93069fa2b2e5b919da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Thu, 6 Jun 2024 17:03:57 +0200 Subject: [PATCH 2/2] Linter --- .gitignore | 1 + .../components/ObjectSortDropdownButton.tsx | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 68f77baf057b..90435e50a198 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .DS_Store /.idea **/**/node_modules/ +.cache # yarn is the recommended package manager across the project **/**/.package-lock.json diff --git a/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx b/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx index 3cd8c7435fec..7694f3329358 100644 --- a/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx +++ b/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx @@ -7,12 +7,12 @@ 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 { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator'; +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'; import { SORT_DIRECTIONS } from '../types/SortDirection'; -import { StyledHeaderDropdownButton } from '@/ui/layout/dropdown/components/StyledHeaderDropdownButton'; -import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown'; export type ObjectSortDropdownButtonProps = { sortDropdownId: string; @@ -34,7 +34,7 @@ export const ObjectSortDropdownButton = ({ handleAddSort, } = useObjectSortDropdown(); - const {isDropdownOpen} = useDropdown(OBJECT_SORT_DROPDOWN_ID); + const { isDropdownOpen } = useDropdown(OBJECT_SORT_DROPDOWN_ID); const handleButtonClick = () => { toggleSortDropdown();