diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 7ec56198d..000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -18.17.1 \ No newline at end of file diff --git a/package.json b/package.json index 3dfd1adc8..b8d411fac 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@sniptt/guards": "^0.2.0", "@stoplight/elements": "^8.0.5", "@swc/jest": "^0.2.29", - "@tabler/icons-react": "^2.44.0", + "@tabler/icons-react": "^3.31.0", "@types/dompurify": "^3.0.5", "@types/facepaint": "^1.2.5", "@types/lodash.camelcase": "^4.3.7", diff --git a/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsx b/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsx new file mode 100644 index 000000000..5bb515f07 --- /dev/null +++ b/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsx @@ -0,0 +1,66 @@ +import { RightDrawerActionMenuDropdownHotkeyScope } from '@/action-menu/types/RightDrawerActionMenuDropdownHotkeyScope'; +import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu'; +import { getLinkToShowPage } from '@/object-metadata/utils/getLinkToShowPage'; +import { ObjectRecord } from '@/object-record/types/ObjectRecord'; +import { AppPath } from '@/types/AppPath'; +import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys'; +import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope'; +import styled from '@emotion/styled'; +import { Link } from 'react-router-dom'; +import { Button, IconBrowserMaximize, getOsControlSymbol } from 'twenty-ui'; +import { useNavigateApp } from '~/hooks/useNavigateApp'; + +const StyledLink = styled(Link)` + text-decoration: none; +`; + +type RecordShowRightDrawerOpenRecordButtonProps = { + objectNameSingular: string; + record: ObjectRecord; +}; + +export const RecordShowRightDrawerOpenRecordButton = ({ + objectNameSingular, + record, +}: RecordShowRightDrawerOpenRecordButtonProps) => { + const { closeCommandMenu } = useCommandMenu(); + + const to = getLinkToShowPage(objectNameSingular, record); + + const navigate = useNavigateApp(); + + const handleOpenRecord = () => { + navigate(AppPath.RecordShowPage, { + objectNameSingular, + objectRecordId: record.id, + }); + closeCommandMenu(); + }; + + useScopedHotkeys( + ['ctrl+Enter,meta+Enter'], + handleOpenRecord, + AppHotkeyScope.CommandMenuOpen, + [closeCommandMenu, navigate, objectNameSingular, record.id], + ); + + useScopedHotkeys( + ['ctrl+Enter,meta+Enter'], + handleOpenRecord, + RightDrawerActionMenuDropdownHotkeyScope.RightDrawerActionMenuDropdown, + [closeCommandMenu, navigate, objectNameSingular, record.id], + ); + + return ( + +