Skip to content

Commit

Permalink
Typo and using details for Toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinleroy committed Aug 1, 2024
1 parent 356f95f commit 44ba0d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ide/packages/panoptes/src/TreeView/BottomUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const RenderBottomUpSets = ({
return (
<TreeAppContext.TreeRenderContext.Provider value={SubsetRenderParams}>
<p>
Argus recommends investigating these failed oblgiations. Click on ’
Argus recommends investigating these failed obligations. Click on ’
{otherLabel}‘ below to see other failed obligations.
</p>
<div id="recommended-failure-list">{argusRecommends}</div>
Expand Down
12 changes: 7 additions & 5 deletions ide/packages/print/src/Toggle.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
.toggle-box {
display: inline;
details.toggle-box {
display: inline-block;
border: 1px solid var(--vscode-textCodeBlock-background);
border-radius: 4px;
}

.toggle-box.expanded {
display: inline-block;
details[open].toggle-box > summary {
display: none;
}

.toggle-box .summary {
details.toggle-box > summary {
list-style: none;

color: var(--vscode-input-placeholderForeground);
font-size: 80%;
}
14 changes: 8 additions & 6 deletions ide/packages/print/src/Toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import classNames from "classnames";
import React, { useState } from "react";

import "./Toggle.css";
Expand All @@ -13,14 +12,17 @@ export const Toggle = ({
const [expanded, setExpanded] = useState(false);
return (
// biome-ignore lint/a11y/useKeyWithClickEvents: TODO
<div
className={classNames("toggle-box", { expanded })}
<details
className="toggle-box"
open={expanded}
onClick={e => {
e.preventDefault();
e.stopPropagation();
setExpanded(!expanded);
setExpanded(e => !e);
}}
>
{expanded ? <Children /> : <span className="summary">{summary}</span>}
</div>
<summary>{summary}</summary>
<Children />
</details>
);
};

0 comments on commit 44ba0d5

Please sign in to comment.