Skip to content

Commit 446c556

Browse files
authored
Fixed entity chip navigate (#5587)
Fixed EntityChip, navigate had been removed during performance optimization, I put it back.
1 parent 10abd7f commit 446c556

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/twenty-ui/src/display/chip/components/EntityChip.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import { useNavigate } from 'react-router-dom';
23
import { useTheme } from '@emotion/react';
34
import { isNonEmptyString } from '@sniptt/guards';
45

@@ -33,11 +34,13 @@ export const EntityChip = ({
3334
LeftIcon,
3435
className,
3536
}: EntityChipProps) => {
37+
const navigate = useNavigate();
3638
const theme = useTheme();
3739

3840
const handleLinkClick = (event: React.MouseEvent<HTMLDivElement>) => {
3941
if (isNonEmptyString(linkToEntity)) {
4042
event.stopPropagation();
43+
navigate(linkToEntity);
4144
}
4245
};
4346

0 commit comments

Comments
 (0)