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 loading = useIsPrefetchLoading();
|
||||||
|
|
||||||
const { toggleNavigationSection, isNavigationSectionOpenState } =
|
const {
|
||||||
useNavigationSection('Favorites');
|
toggleNavigationSection,
|
||||||
|
isNavigationSectionOpenState,
|
||||||
|
openNavigationSection,
|
||||||
|
} = useNavigationSection('Favorites');
|
||||||
const isNavigationSectionOpen = useRecoilValue(isNavigationSectionOpenState);
|
const isNavigationSectionOpen = useRecoilValue(isNavigationSectionOpenState);
|
||||||
|
|
||||||
const toggleNewFolder = () => {
|
const toggleNewFolder = () => {
|
||||||
|
openNavigationSection();
|
||||||
setIsFavoriteFolderCreating((current) => !current);
|
setIsFavoriteFolderCreating((current) => !current);
|
||||||
};
|
};
|
||||||
const shouldDisplayFavoritesWithFeatureFlagEnabled = true;
|
const shouldDisplayFavoritesWithFeatureFlagEnabled = true;
|
||||||
|
|||||||
@ -2,9 +2,11 @@ import { FAVORITE_FOLDER_PICKER_DROPDOWN_ID } from '@/favorites/favorite-folder-
|
|||||||
import { isFavoriteFolderCreatingState } from '@/favorites/states/isFavoriteFolderCreatingState';
|
import { isFavoriteFolderCreatingState } from '@/favorites/states/isFavoriteFolderCreatingState';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
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 { useTheme } from '@emotion/react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { useRecoilState } from 'recoil';
|
import { useRecoilState, useSetRecoilState } from 'recoil';
|
||||||
import { IconPlus, MenuItem } from 'twenty-ui';
|
import { IconPlus, MenuItem } from 'twenty-ui';
|
||||||
|
|
||||||
const StyledFooter = styled.div`
|
const StyledFooter = styled.div`
|
||||||
@ -18,6 +20,10 @@ export const FavoriteFolderPickerFooter = () => {
|
|||||||
const [, setIsFavoriteFolderCreating] = useRecoilState(
|
const [, setIsFavoriteFolderCreating] = useRecoilState(
|
||||||
isFavoriteFolderCreatingState,
|
isFavoriteFolderCreatingState,
|
||||||
);
|
);
|
||||||
|
const setIsNavigationDrawerExpanded = useSetRecoilState(
|
||||||
|
isNavigationDrawerExpandedState,
|
||||||
|
);
|
||||||
|
const { openNavigationSection } = useNavigationSection('Favorites');
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { closeDropdown } = useDropdown(FAVORITE_FOLDER_PICKER_DROPDOWN_ID);
|
const { closeDropdown } = useDropdown(FAVORITE_FOLDER_PICKER_DROPDOWN_ID);
|
||||||
|
|
||||||
@ -27,6 +33,8 @@ export const FavoriteFolderPickerFooter = () => {
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
className="add-folder"
|
className="add-folder"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setIsNavigationDrawerExpanded(true);
|
||||||
|
openNavigationSection();
|
||||||
setIsFavoriteFolderCreating(true);
|
setIsFavoriteFolderCreating(true);
|
||||||
closeDropdown();
|
closeDropdown();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ const StyledItem = styled.div<{ isNavigationDrawerExpanded: boolean }>`
|
|||||||
|
|
||||||
const StyledItemElementsContainer = styled.span`
|
const StyledItemElementsContainer = styled.span`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: ${({ theme }) => theme.spacing(2)};
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
`;
|
`;
|
||||||
@ -53,6 +53,7 @@ const StyledTextInput = styled.input`
|
|||||||
${TEXT_INPUT_STYLE}
|
${TEXT_INPUT_STYLE}
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const NavigationDrawerInput = ({
|
export const NavigationDrawerInput = ({
|
||||||
@ -115,7 +116,9 @@ export const NavigationDrawerInput = ({
|
|||||||
<StyledItemElementsContainer>
|
<StyledItemElementsContainer>
|
||||||
{Icon && (
|
{Icon && (
|
||||||
<Icon
|
<Icon
|
||||||
style={{ minWidth: theme.icon.size.md }}
|
style={{
|
||||||
|
minWidth: theme.icon.size.md,
|
||||||
|
}}
|
||||||
size={theme.icon.size.md}
|
size={theme.icon.size.md}
|
||||||
stroke={theme.icon.stroke.md}
|
stroke={theme.icon.stroke.md}
|
||||||
color="currentColor"
|
color="currentColor"
|
||||||
|
|||||||
Reference in New Issue
Block a user