Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aria-label to correct/incorrect icons #80

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ const ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {
isCorrect: {
icon: faCheck,
color: colors.answer.correct,
label: 'Correct',
},
isIncorrect: {
icon: faXmark,
color: colors.answer.incorrect,
label: 'Incorrect',
},
}[variant];

Expand All @@ -112,6 +114,8 @@ const ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {
color={variantData.color}
height='16px'
width='16px'
aria-label={variantData.label}
aria-hidden={undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

necessary? this is the default

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm I see why you added it

/>;
}

Expand Down
18 changes: 9 additions & 9 deletions src/components/__snapshots__/ProgressBar.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`ProgressBar matches snapshot 1`] = `
1
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`ProgressBar matches snapshot 1`] = `
2
</button>
<svg
aria-hidden="true"
aria-label="Correct"
className="svg-inline--fa fa-check sc-hKMtZM cCtdaL"
color="#0D7741"
data-icon="check"
Expand Down Expand Up @@ -81,7 +81,7 @@ exports[`ProgressBar matches snapshot 1`] = `
3
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -180,7 +180,7 @@ exports[`ProgressBar matches snapshot when active step is incomplete 1`] = `
1
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -212,7 +212,7 @@ exports[`ProgressBar matches snapshot when active step is incomplete 1`] = `
2
</button>
<svg
aria-hidden="true"
aria-label="Correct"
className="svg-inline--fa fa-check sc-hKMtZM cCtdaL"
color="#0D7741"
data-icon="check"
Expand Down Expand Up @@ -244,7 +244,7 @@ exports[`ProgressBar matches snapshot when active step is incomplete 1`] = `
3
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -343,7 +343,7 @@ exports[`ProgressBar matches snapshot when status step is active 1`] = `
1
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -375,7 +375,7 @@ exports[`ProgressBar matches snapshot when status step is active 1`] = `
2
</button>
<svg
aria-hidden="true"
aria-label="Correct"
className="svg-inline--fa fa-check sc-hKMtZM cCtdaL"
color="#0D7741"
data-icon="check"
Expand Down Expand Up @@ -407,7 +407,7 @@ exports[`ProgressBar matches snapshot when status step is active 1`] = `
3
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down
Loading