1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

chore: fix command bar key prop usage (#7534)

This commit is contained in:
David Leek 2024-07-05 08:24:51 +02:00 committed by GitHub
parent 96a1996b41
commit 233bf0757e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View File

@ -19,6 +19,7 @@ const toListItemButton = (
if (item.featureId && item.projectId) {
return (
<RecentlyVisitedFeatureButton
keyName={key}
key={key}
featureId={item.featureId}
projectId={item.projectId}
@ -29,6 +30,7 @@ const toListItemButton = (
if (item.projectId) {
return (
<RecentlyVisitedProjectButton
keyName={key}
key={key}
projectId={item.projectId}
onClick={onClick}
@ -39,6 +41,7 @@ const toListItemButton = (
const name = routes[item.pathName]?.title ?? item.pathName;
return (
<RecentlyVisitedPathButton
keyName={key}
key={key}
path={item.pathName}
name={name}

View File

@ -69,13 +69,13 @@ const ButtonItemIcon = ({
};
export const RecentlyVisitedPathButton = ({
keyName,
path,
key,
name,
onClick,
}: {
path: string;
key: string;
keyName: string;
name: string;
onClick: () => void;
}) => {
@ -95,7 +95,7 @@ export const RecentlyVisitedPathButton = ({
return (
<ListItemButton
key={key}
key={keyName}
dense={true}
component={Link}
to={path}
@ -116,11 +116,11 @@ export const RecentlyVisitedPathButton = ({
export const RecentlyVisitedProjectButton = ({
projectId,
key,
keyName,
onClick,
}: {
projectId: string;
key: string;
keyName: string;
onClick: () => void;
}) => {
const { trackEvent } = usePlausibleTracker();
@ -141,7 +141,7 @@ export const RecentlyVisitedProjectButton = ({
if (projectDeleted) return null;
return (
<ListItemButton
key={key}
key={keyName}
dense={true}
component={Link}
to={`/projects/${projectId}`}
@ -161,12 +161,12 @@ export const RecentlyVisitedProjectButton = ({
};
export const RecentlyVisitedFeatureButton = ({
key,
keyName,
projectId,
featureId,
onClick,
}: {
key: string;
keyName: string;
projectId: string;
featureId: string;
onClick: () => void;
@ -185,7 +185,7 @@ export const RecentlyVisitedFeatureButton = ({
};
return (
<ListItemButton
key={key}
key={keyName}
dense={true}
component={Link}
to={`/projects/${projectId}/features/${featureId}`}