Fixed entity chip navigate (#5587)

Fixed EntityChip, navigate had been removed during performance
optimization, I put it back.
This commit is contained in:
Lucas Bordeau 2024-05-27 11:30:01 +02:00 committed by GitHub
parent 10abd7f0ad
commit 446c5564d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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';
@ -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);
}
};