Skip to content

test: add cypress end-to-end test setup #313

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

Merged
merged 9 commits into from
Dec 7, 2020
Prev Previous commit
Next Next commit
Update to use section and to accept aria-label as labelText property
ddehart committed Dec 7, 2020
commit 6c87a40e58d3915f6906d3d8f3237fe9c6452ff9
7 changes: 4 additions & 3 deletions src/components/Expandable.js
Original file line number Diff line number Diff line change
@@ -3,18 +3,19 @@ import IconButton from './IconButton';
import Scrollable from './Scrollable';
import { ChevronUpIcon, ChevronDownIcon } from '@primer/octicons-react';

function Expandable({ excerpt, children, className, variant }) {
function Expandable({ excerpt, children, className, variant, labelText }) {
const [expanded, setExpanded] = useState(false);

return (
<div
<section
className={[
'flex-none py-2 px-4 flex justify-between w-full',
expanded ? 'expanded items-start' : 'collapsed items-center',
className,
]
.filter(Boolean)
.join(' ')}
aria-label={labelText}
>
{expanded && (
<div className="absolute bottom-0 -ml-4 h-full w-full overflow-hidden bg-inherit rounded-inherit">
@@ -50,7 +51,7 @@ function Expandable({ excerpt, children, className, variant }) {
>
<ChevronUpIcon />
</IconButton>
</div>
</section>
);
}