Skip to content

Commit 2789e4b

Browse files
committed
refactor: Minor code cleanup and accessibility improvements
1 parent 4840b22 commit 2789e4b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

frontend/src/components/CustomMenu.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
export function CustomMenu({ items, activeMenuItem, onItemClick }: Object) {
2-
const linkCombo = 'link mh2 blue-dark ttc pointer hover-black';
2+
const linkCombo = 'link mh2 blue-dark ttc pointer hover-black bw0 bg-transparent';
33
const isActive = (itemId) => itemId === activeMenuItem;
44

55
return (
66
<div className="cf mb2 pb3 pt3-ns ph2-m dib flex bg-grey-light">
77
{items.map((item) => (
8-
<div
8+
<button
99
key={item.id}
10-
className={isActive(item.id) ? `${linkCombo} bb b--blue-dark bw1 pb1` : linkCombo}
10+
className={
11+
isActive(item.id) ? `${linkCombo} bw1 br-0 bl-0 bt-0 b--blue-dark pb1` : linkCombo
12+
}
1113
onClick={() => onItemClick(item.id)}
1214
>
1315
<span className="db dib-ns">{item.label}</span>
14-
</div>
16+
</button>
1517
))}
1618
</div>
1719
);

frontend/src/components/teamsAndOrgs/TeamLinkedProjects.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function TeamLinkedProjects({ viewAllEndpoint, border = true, canUserEdit
2424
const [selectedProjectStatus, setSelectedProjectStatus] = useState('PUBLISHED');
2525

2626
// eslint-disable-next-line no-unused-vars
27-
const [projectsError, projectsLoading, projects, refetch] = useFetchWithAbort(
27+
const [, , projects, refetch] = useFetchWithAbort(
2828
`projects/?teamId=${id}&omitMapResults=true&projectStatuses=${selectedProjectStatus}`,
2929
id,
3030
);
@@ -47,7 +47,7 @@ export function TeamLinkedProjects({ viewAllEndpoint, border = true, canUserEdit
4747
</h3>
4848
<ViewAllLink link={viewAllEndpoint} />
4949
<div className="pv2">
50-
<div style={{ width: '230px' }}>
50+
<div style={{ width: '280px' }}>
5151
<CustomMenu
5252
items={items}
5353
activeMenuItem={selectedProjectStatus}
@@ -63,6 +63,7 @@ export function TeamLinkedProjects({ viewAllEndpoint, border = true, canUserEdit
6363
>
6464
{projects?.results?.map((card) => (
6565
<TeamLinkedProjectCard
66+
key={card.projectId}
6667
projectId={card.projectId}
6768
projectName={card.name}
6869
unLinkFunc={canUserEditTeam ? unLinkProjectFromTeam : () => {}}

0 commit comments

Comments
 (0)