Skip to content

Commit

Permalink
Enhancing expandable headers
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver committed Oct 15, 2024
1 parent a46288f commit 70c6e52
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions website/src/components/collapsible/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ function Collapsible({children, header, description, expand}) {
return (
<>
<h2 onClick={toggleExpanded}>
<React.Fragment>
<span style={{ color: expanded ? 'orange' : 'orange' }} aria-hidden="true">
{ expanded ? ' ^ ' : ' > ' }
</span>
{header}
{ expanded ? ' -' : ' +' }
</React.Fragment>
</h2>
{ expanded ? children : <span>{ description ? description : "Click to expand" }</span> }
{ expanded ? children : <span>{ description ? description : "Click above for details" }</span> }
</>
);
}

export default Collapsible;

0 comments on commit 70c6e52

Please sign in to comment.