Removed last old DropdownButton (#1573)
* Removed last old DropdownButton * Update front/src/modules/ui/view-bar/components/SingleEntityFilterDropdownButton.tsx Co-authored-by: Thaïs <guigon.thais@gmail.com> * Fix CI --------- Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com> Co-authored-by: Thaïs <guigon.thais@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,16 +1,13 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useRef } from 'react';
|
||||
import { Keys } from 'react-hotkeys-hook';
|
||||
import { flip, offset, Placement, useFloating } from '@floating-ui/react';
|
||||
|
||||
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
|
||||
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
|
||||
import { useRecoilScopedFamilyState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedFamilyState';
|
||||
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
||||
|
||||
import { HotkeyEffect } from '../../utilities/hotkey/components/HotkeyEffect';
|
||||
import { useDropdownButton } from '../hooks/useDropdownButton';
|
||||
import { dropdownButtonCustomHotkeyScopeScopedFamilyState } from '../states/dropdownButtonCustomHotkeyScopeScopedFamilyState';
|
||||
import { DropdownRecoilScopeContext } from '../states/recoil-scope-contexts/DropdownRecoilScopeContext';
|
||||
import { useInternalHotkeyScopeManagement } from '../hooks/useInternalHotkeyScopeManagement';
|
||||
|
||||
type OwnProps = {
|
||||
buttonComponents: JSX.Element | JSX.Element[];
|
||||
@ -57,22 +54,10 @@ export function DropdownButton({
|
||||
},
|
||||
});
|
||||
|
||||
const [dropdownButtonCustomHotkeyScope, setDropdownButtonCustomHotkeyScope] =
|
||||
useRecoilScopedFamilyState(
|
||||
dropdownButtonCustomHotkeyScopeScopedFamilyState,
|
||||
dropdownId,
|
||||
DropdownRecoilScopeContext,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDeeplyEqual(dropdownButtonCustomHotkeyScope, dropdownHotkeyScope)) {
|
||||
setDropdownButtonCustomHotkeyScope(dropdownHotkeyScope);
|
||||
}
|
||||
}, [
|
||||
useInternalHotkeyScopeManagement({
|
||||
dropdownId,
|
||||
dropdownHotkeyScope,
|
||||
dropdownButtonCustomHotkeyScope,
|
||||
setDropdownButtonCustomHotkeyScope,
|
||||
]);
|
||||
});
|
||||
|
||||
return (
|
||||
<div ref={containerRef}>
|
||||
|
||||
Reference in New Issue
Block a user