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

Issue 779 cleanup faq #1017

Merged
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
7 changes: 5 additions & 2 deletions documentation-website/src/components/faq-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
list-style-type: none;
width: 100%;

&:focus {
box-shadow: 0 0 2em var(--shadow);
& > button {
width: 100%;
&:focus {
box-shadow: 0 0 2em var(--shadow);
}
}

.accordion-section {
Expand Down
34 changes: 14 additions & 20 deletions documentation-website/src/components/faq-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,33 @@ const FaqItem = ({
setIsOpen(! isOpen,);
};

const handleKeyDown = (e: React.KeyboardEvent<HTMLLIElement>,) => {
if (e.key === 'Enter') {
toggleOpen();
}
};

return (
<li tabIndex={index + ONE} onKeyDown={handleKeyDown} className={'faq-item'}>
<div onClick={() => toggleOpen()} role="button">
<li className={ 'faq-item' }>
<button tabIndex={ index + ONE } onClick={ () => toggleOpen() }>
<div className="accordion-section">
<h2>
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
<Lang lnkey={`faq.questions.title_${ index + ONE }`} />
<Lang lnkey={ `faq.questions.title_${ index + ONE }` }/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Investigate and resolve TypeScript errors suppressed by @ts-expect-error.

Also applies to: 42-44

}
</h2>
{isOpen ?
{ isOpen ?
<span className="up-arrow"></span>
:
<span className="down-arrow"></span>
}
</div>
</div>
{isOpen &&
<p>
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
<Lang lnkey={`faq.questions.description_${ index + ONE }`} />
}
</p>
}
{ isOpen &&
<p>
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
<Lang lnkey={ `faq.questions.description_${ index + ONE }` }/>
}
</p>
}
</button>
</li>
);
};
Expand Down
Loading