Skip to content

Commit

Permalink
chore: fix command bar key prop usage (#7534)
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek authored Jul 5, 2024
1 parent 96a1996 commit 233bf07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions frontend/src/component/commandBar/CommandQuickSuggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const toListItemButton = (
if (item.featureId && item.projectId) {
return (
<RecentlyVisitedFeatureButton
keyName={key}
key={key}
featureId={item.featureId}
projectId={item.projectId}
Expand All @@ -29,6 +30,7 @@ const toListItemButton = (
if (item.projectId) {
return (
<RecentlyVisitedProjectButton
keyName={key}
key={key}
projectId={item.projectId}
onClick={onClick}
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ const ButtonItemIcon = ({
};

export const RecentlyVisitedPathButton = ({
keyName,
path,
key,
name,
onClick,
}: {
path: string;
key: string;
keyName: string;
name: string;
onClick: () => void;
}) => {
Expand All @@ -95,7 +95,7 @@ export const RecentlyVisitedPathButton = ({

return (
<ListItemButton
key={key}
key={keyName}
dense={true}
component={Link}
to={path}
Expand All @@ -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();
Expand All @@ -141,7 +141,7 @@ export const RecentlyVisitedProjectButton = ({
if (projectDeleted) return null;
return (
<ListItemButton
key={key}
key={keyName}
dense={true}
component={Link}
to={`/projects/${projectId}`}
Expand All @@ -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;
Expand All @@ -185,7 +185,7 @@ export const RecentlyVisitedFeatureButton = ({
};
return (
<ListItemButton
key={key}
key={keyName}
dense={true}
component={Link}
to={`/projects/${projectId}/features/${featureId}`}
Expand Down

0 comments on commit 233bf07

Please sign in to comment.