Skip to content

Commit b597b43

Browse files
committed
Adjust how the card elements are read by screen readers
1 parent fd46a42 commit b597b43

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/tests/Projects.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("Projects", () => {
4444
const projectImage = projectCard.children[1] as HTMLImageElement;;
4545
// If there are any special characters in the image's url, encode them
4646
expect(projectImage.src).toBe(`${window.location.origin}${encodeURI(project.image)}`);
47-
expect(projectImage.alt).toBe(project.name);
47+
expect(projectImage.alt).toBe(`Screenshot of ${project.name}`);
4848

4949
const projectAbout = projectCard.children[2] as HTMLParagraphElement;
5050
expect(projectAbout).toHaveTextContent(project.about);

src/tsx/Projects.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,12 @@ const Projects: React.FC<OnClickProp> = ({ onClickLink }) => {
5656
<img
5757
className="projects-image card-img-top"
5858
src={project.image}
59-
alt={project.name}
59+
alt={`Screenshot of ${project.name}`}
6060
/>
6161
<p className="projects-about card-text">
6262
{project.about}
6363
</p>
64-
<p
65-
className="projects-technology-header"
66-
aria-label={`Made using: ${project.technology}`}
67-
>
64+
<p className="projects-technology-header">
6865
Made Using:
6966
</p>
7067
<div className="projects-technology-container">

0 commit comments

Comments
 (0)