Fixed drawer not closing on task creation on Show Page (#3867)

Fixed close dropdown
This commit is contained in:
Lucas Bordeau
2024-02-08 14:12:23 +01:00
committed by GitHub
parent 00a46b21dc
commit e2db6a994d
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import { IconCheckbox, IconNotes, IconPlus } from '@/ui/display/icon/index';
import { IconButton } from '@/ui/input/button/components/IconButton';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
import { SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID } from '@/ui/layout/show-page/constants/ShowPageAddButtonDropdownId';
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
import { Dropdown } from '../../dropdown/components/Dropdown';
@ -22,7 +23,9 @@ export const ShowPageAddButton = ({
}: {
entity: ActivityTargetableObject;
}) => {
const { closeDropdown, toggleDropdown } = useDropdown('add-show-page');
const { closeDropdown, toggleDropdown } = useDropdown(
SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID,
);
const openCreateActivity = useOpenCreateActivityDrawer();
const handleSelect = (type: ActivityType) => {
@ -33,7 +36,7 @@ export const ShowPageAddButton = ({
return (
<StyledContainer>
<Dropdown
dropdownId="show-page-add-button-dropdown-id"
dropdownId={SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID}
clickableComponent={
<IconButton
Icon={IconPlus}

View File

@ -0,0 +1 @@
export const SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID = 'show-page-add-button-dropdown';