Use ToggleSwitches for binary options

Summary:
We've had a bunch of different options that were all binary
switches with very different ways of displaying them.

This consolidates them all to use ToggleSwitches. I think it
may still make sense to move them all to a sidebar as it's
the case for the Analytics plugin, but that's for another diff.

Reviewed By: danielbuechele

Differential Revision: D14933392

fbshipit-source-id: 7ef286b61142a564a7cde6de875266ac8641704b
This commit is contained in:
Pascal Hartig
2019-04-17 10:21:35 -07:00
committed by Facebook Github Bot
parent c244946be3
commit 6db83a7675
2 changed files with 53 additions and 18 deletions

View File

@@ -40,6 +40,7 @@ type Props = {
* whether the button is toggled
*/
toggled?: boolean,
className?: string,
};
/**
@@ -55,7 +56,11 @@ type Props = {
export default class ToggleButton extends React.Component<Props> {
render() {
return (
<StyledButton toggled={this.props.toggled} onClick={this.props.onClick} />
<StyledButton
className={this.props.className}
toggled={this.props.toggled}
onClick={this.props.onClick}
/>
);
}
}