-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] fix navigation overflow #7795
Changes from 3 commits
a6c3f69
9369df0
a3859f5
0525c2d
0bc659f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { useLastVisitedView } from '@/navigation/hooks/useLastVisitedView'; | ||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; | ||
import { NavigationDrawerAnimatedCollapseWrapper } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerAnimatedCollapseWrapper'; | ||
import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem'; | ||
import { NavigationDrawerItemsCollapsedContainer } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItemsCollapsedContainer'; | ||
import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection'; | ||
import { NavigationDrawerAnimatedCollapseWrapper } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerAnimatedCollapseWrapper'; | ||
import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle'; | ||
import { NavigationDrawerSubItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSubItem'; | ||
import { useNavigationSection } from '@/ui/navigation/navigation-drawer/hooks/useNavigationSection'; | ||
import { getNavigationSubItemState } from '@/ui/navigation/navigation-drawer/utils/getNavigationSubItemState'; | ||
import { View } from '@/views/types/View'; | ||
import { getObjectMetadataItemViews } from '@/views/utils/getObjectMetadataItemViews'; | ||
import styled from '@emotion/styled'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { useIcons } from 'twenty-ui'; | ||
import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle'; | ||
import { NavigationDrawerItemsCollapsedContainer } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItemsCollapsedContainer'; | ||
const ORDERED_STANDARD_OBJECTS = [ | ||
'person', | ||
'company', | ||
|
@@ -21,6 +22,16 @@ const ORDERED_STANDARD_OBJECTS = [ | |
'note', | ||
]; | ||
|
||
const ObjectsMetaDataItemsWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${({ theme }) => theme.betweenSiblingsGap}; | ||
width: 100%; | ||
margin-bottom: ${({ theme }) => theme.spacing(3)}; | ||
flex: 1; | ||
overflow-y: auto; | ||
`; | ||
|
||
export const NavigationDrawerSectionForObjectMetadataItems = ({ | ||
sectionTitle, | ||
isRemote, | ||
|
@@ -136,7 +147,9 @@ export const NavigationDrawerSectionForObjectMetadataItems = ({ | |
onClick={() => toggleNavigationSection()} | ||
/> | ||
</NavigationDrawerAnimatedCollapseWrapper> | ||
{isNavigationSectionOpen && renderObjectMetadataItems()} | ||
<ObjectsMetaDataItemsWrapper> | ||
{isNavigationSectionOpen && renderObjectMetadataItems()} | ||
</ObjectsMetaDataItemsWrapper> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Ensure that the scrollable area doesn't interfere with other navigation elements when empty |
||
</NavigationDrawerSection> | ||
) | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage'; | ||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded'; | ||
import { useTheme } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
import { AnimationControls, motion, TargetAndTransition } from 'framer-motion'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded'; | ||
import { useTheme } from '@emotion/react'; | ||
import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage'; | ||
|
||
const StyledAnimatedContainer = styled(motion.div)``; | ||
|
||
|
@@ -44,7 +44,7 @@ export const NavigationDrawerAnimatedCollapseWrapper = ({ | |
transition={{ | ||
duration: theme.animation.duration.normal, | ||
}} | ||
> | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: There's an extra space at the end of this line |
||
{children} | ||
</StyledAnimatedContainer> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ const StyledSection = styled.div` | |
gap: ${({ theme }) => theme.betweenSiblingsGap}; | ||
width: 100%; | ||
margin-bottom: ${({ theme }) => theme.spacing(3)}; | ||
flex-shrink: 1; | ||
overflow: hidden | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Missing semicolon at the end of the CSS property There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Consider using |
||
`; | ||
|
||
export { StyledSection as NavigationDrawerSection }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding a max-height property to ensure the container doesn't grow indefinitely