diff --git a/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerTopBar.tsx b/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerTopBar.tsx index b80b943e1730..2a5945c5bd7d 100644 --- a/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerTopBar.tsx +++ b/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerTopBar.tsx @@ -85,13 +85,14 @@ export const RightDrawerTopBar = () => { const ObjectIcon = getIcon(objectMetadataItem.icon); - const label = - rightDrawerPage === RightDrawerPages.ViewRecord - ? objectMetadataItem.labelSingular - : RIGHT_DRAWER_PAGE_TITLES[rightDrawerPage]; + const isViewRecordRightDrawerPage = + rightDrawerPage === RightDrawerPages.ViewRecord; - const Icon = - rightDrawerPage === RightDrawerPages.ViewRecord ? ObjectIcon : PageIcon; + const label = isViewRecordRightDrawerPage + ? objectMetadataItem.labelSingular + : RIGHT_DRAWER_PAGE_TITLES[rightDrawerPage]; + + const Icon = isViewRecordRightDrawerPage ? ObjectIcon : PageIcon; return ( { )} - {!isMobile && !isRightDrawerMinimized && ( - - )} + {!isMobile && + !isRightDrawerMinimized && + isViewRecordRightDrawerPage && ( + + )} +