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

View File

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