fix: navigation drawer clip while making folder in favorites (#8619)
This commit is contained in:
@ -43,11 +43,15 @@ export const CurrentWorkspaceMemberFavoritesFolders = () => {
|
||||
);
|
||||
const loading = useIsPrefetchLoading();
|
||||
|
||||
const { toggleNavigationSection, isNavigationSectionOpenState } =
|
||||
useNavigationSection('Favorites');
|
||||
const {
|
||||
toggleNavigationSection,
|
||||
isNavigationSectionOpenState,
|
||||
openNavigationSection,
|
||||
} = useNavigationSection('Favorites');
|
||||
const isNavigationSectionOpen = useRecoilValue(isNavigationSectionOpenState);
|
||||
|
||||
const toggleNewFolder = () => {
|
||||
openNavigationSection();
|
||||
setIsFavoriteFolderCreating((current) => !current);
|
||||
};
|
||||
const shouldDisplayFavoritesWithFeatureFlagEnabled = true;
|
||||
|
||||
@ -2,9 +2,11 @@ import { FAVORITE_FOLDER_PICKER_DROPDOWN_ID } from '@/favorites/favorite-folder-
|
||||
import { isFavoriteFolderCreatingState } from '@/favorites/states/isFavoriteFolderCreatingState';
|
||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { useNavigationSection } from '@/ui/navigation/navigation-drawer/hooks/useNavigationSection';
|
||||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { useRecoilState, useSetRecoilState } from 'recoil';
|
||||
import { IconPlus, MenuItem } from 'twenty-ui';
|
||||
|
||||
const StyledFooter = styled.div`
|
||||
@ -18,6 +20,10 @@ export const FavoriteFolderPickerFooter = () => {
|
||||
const [, setIsFavoriteFolderCreating] = useRecoilState(
|
||||
isFavoriteFolderCreatingState,
|
||||
);
|
||||
const setIsNavigationDrawerExpanded = useSetRecoilState(
|
||||
isNavigationDrawerExpandedState,
|
||||
);
|
||||
const { openNavigationSection } = useNavigationSection('Favorites');
|
||||
const theme = useTheme();
|
||||
const { closeDropdown } = useDropdown(FAVORITE_FOLDER_PICKER_DROPDOWN_ID);
|
||||
|
||||
@ -27,6 +33,8 @@ export const FavoriteFolderPickerFooter = () => {
|
||||
<MenuItem
|
||||
className="add-folder"
|
||||
onClick={() => {
|
||||
setIsNavigationDrawerExpanded(true);
|
||||
openNavigationSection();
|
||||
setIsFavoriteFolderCreating(true);
|
||||
closeDropdown();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user