Skip to content

Commit

Permalink
Fixed entity chip navigate (twentyhq#5587)
Browse files Browse the repository at this point in the history
Fixed EntityChip, navigate had been removed during performance
optimization, I put it back.
  • Loading branch information
lucasbordeau authored May 27, 2024
1 parent 10abd7f commit 446c556
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/twenty-ui/src/display/chip/components/EntityChip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
import { useTheme } from '@emotion/react';
import { isNonEmptyString } from '@sniptt/guards';

Expand Down Expand Up @@ -33,11 +34,13 @@ export const EntityChip = ({
LeftIcon,
className,
}: EntityChipProps) => {
const navigate = useNavigate();
const theme = useTheme();

const handleLinkClick = (event: React.MouseEvent<HTMLDivElement>) => {
if (isNonEmptyString(linkToEntity)) {
event.stopPropagation();
navigate(linkToEntity);
}
};

Expand Down

0 comments on commit 446c556

Please sign in to comment.