-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move panel toggles to control headers
Do this by extending annotatedHeader to take an optional toggle, then using it for all available panels. Simplify headers and translations to just the panel name (e.g. Tree) instead of "Show <panel name>" / "<panel name> Options". Repurpose and move the section "Panel Options" to the top as "Layout". Conditionally render that entire section including the header.
- Loading branch information
Showing
18 changed files
with
153 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// A slider toggle to adjust the state of a panel via dispatch. | ||
|
||
import React from "react"; | ||
import { useDispatch } from "react-redux"; | ||
|
||
import Toggle from "./toggle"; | ||
import { togglePanelDisplay } from "../../actions/panelDisplay"; | ||
|
||
type Props = { | ||
panel: string | ||
on: boolean | ||
} | ||
|
||
const PanelToggle = ({ panel, on }: Props) => { | ||
const dispatch = useDispatch(); | ||
|
||
// There is no slider label since the title in the annotated header acts as a | ||
// visual label. | ||
// FIXME: Add a hidden label? | ||
|
||
return ( | ||
<Toggle | ||
display={true} | ||
on={on} | ||
callback={() => dispatch(togglePanelDisplay(panel))} | ||
label={""} | ||
style={{display: "inline"}} | ||
/> | ||
); | ||
}; | ||
|
||
export default PanelToggle; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.