Skip to content

Commit

Permalink
Merge pull request #851 from gympass/feat/improve-accessibility-from-…
Browse files Browse the repository at this point in the history
…action-requirement-component

feat(ActionRequirement): improve accessibility
  • Loading branch information
flavia-moraes authored Nov 27, 2024
2 parents 14c7d64 + d1ad094 commit ad78e56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions packages/yoga/src/ActionRequirement/web/ActionRequirement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ function ActionRequirement(props) {
defineCompoundComponents();
return (
<StyledActionRequirement {...props}>
{illustration && <BoxIllustration>{illustration}</BoxIllustration>}

{illustration && (
<BoxIllustration aria-hidden>{illustration}</BoxIllustration>
)}
<Content>
{titleAsTextDisplay ? (
<Text.Display2>{title}</Text.Display2>
<Text.Display2 as="h1">{title}</Text.Display2>
) : (
<Title>{title}</Title>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Box from '../../Box';
import Button from '../../Button';

export const Title = styled(Text.H4).attrs({
as: 'p',
as: 'h1',
bold: true,
})`
${({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ exports[`<ActionRequirement /> should default match snapshot 1`] = `
<div
class="c1"
>
<p
<h1
class="c2"
>
title
</p>
</h1>
<p
class="c3"
color="deep"
Expand Down Expand Up @@ -271,11 +271,11 @@ exports[`<ActionRequirement /> should match snapshot with list 1`] = `
<div
class="c1"
>
<p
<h1
class="c2"
>
title
</p>
</h1>
<p
class="c3"
color="deep"
Expand Down Expand Up @@ -418,11 +418,11 @@ exports[`<ActionRequirement /> should match snapshot with text display 1`] = `
<div
class="c1"
>
<p
<h1
class="c2"
>
title
</p>
</h1>
<p
class="c3"
color="deep"
Expand Down

0 comments on commit ad78e56

Please sign in to comment.