fixed focustrap and accessibility

This commit is contained in:
ronronscelestes 2021-09-07 18:38:34 +02:00
parent 8d3bf50a08
commit 8721c65c19
2 changed files with 18 additions and 10 deletions

View File

@ -91,13 +91,20 @@ const Onboarding = () => {
};
return (
<FocusTrap onEscape={handleClick}>
<Wrapper onClick={handleClick}>
{!isOpen && <FontAwesomeIcon icon={faQuestion} />}
{isOpen && <FontAwesomeIcon icon={faTimes} />}
{/* FIX ME - replace with popover when overflow popover is fixed
+ when v4 mockups for onboarding component are ready */}
{isOpen && (
<Wrapper
aria-label={formatMessage({
id: 'app.components.Onboarding.help.button',
defaultMessage: 'Help Button',
})}
type="button"
onClick={handleClick}
>
{!isOpen && <FontAwesomeIcon icon={faQuestion} />}
{isOpen && <FontAwesomeIcon icon={faTimes} />}
{/* FIX ME - replace with popover when overflow popover is fixed
+ when v4 mockups for onboarding component are ready */}
{isOpen && (
<FocusTrap onEscape={handleClick}>
<LinksWrapper
background="neutral0"
hasRadius
@ -117,9 +124,9 @@ const Onboarding = () => {
</StyledLink>
))}
</LinksWrapper>
)}
</Wrapper>
</FocusTrap>
</FocusTrap>
)}
</Wrapper>
);
};

View File

@ -265,6 +265,7 @@
"app.components.NotFoundPage.back": "Back to homepage",
"app.components.NotFoundPage.description": "Not Found",
"app.components.Official": "Official",
"app.components.Onboarding.help.button": "Help button",
"app.components.Onboarding.label.completed": "% completed",
"app.components.Onboarding.title": "Get Started Videos",
"app.components.MarketplaceBanner": "Discover plugins built by the community, and many more awesome things to kickstart your project, on Strapi Awesome.",