aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/common.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-06-02 23:45:36 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-06-02 23:45:36 -0700
commite31aa39fc28645fe27646b1e6c6f7e876280ed69 (patch)
tree8536a77b278d8182205e8ba757e1e1f00ac67d76 /web/src/js/components/common.js
parent65fde7f5547f179c80d5858f1ab69583b63fd099 (diff)
parent5321f15defcef641bf5b7ba39e5c9057d562c5f8 (diff)
downloadmitmproxy-e31aa39fc28645fe27646b1e6c6f7e876280ed69.tar.gz
mitmproxy-e31aa39fc28645fe27646b1e6c6f7e876280ed69.tar.bz2
mitmproxy-e31aa39fc28645fe27646b1e6c6f7e876280ed69.zip
Merge branch 'redux-ducks'
Diffstat (limited to 'web/src/js/components/common.js')
-rw-r--r--web/src/js/components/common.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/web/src/js/components/common.js b/web/src/js/components/common.js
index 87c34ffc..3496f1de 100644
--- a/web/src/js/components/common.js
+++ b/web/src/js/components/common.js
@@ -108,18 +108,17 @@ export var Splitter = React.createClass({
}
});
-export const ToggleButton = (props) =>
- <div className="input-group toggle-btn">
- <div
- className={"btn " + (props.checked ? "btn-primary" : "btn-default")}
- onClick={props.onToggleChanged}>
- <span className={"fa " + (props.checked ? "fa-check-square-o" : "fa-square-o")}>&nbsp;{props.name}</span>
- </div>
+export const ToggleButton = ({checked, onToggle, text}) =>
+ <div className={"btn btn-toggle " + (checked ? "btn-primary" : "btn-default")} onClick={onToggle}>
+ <i className={"fa fa-fw " + (checked ? "fa-check-square-o" : "fa-square-o")}/>
+ &nbsp;
+ {text}
</div>;
ToggleButton.propTypes = {
- name: React.PropTypes.string.isRequired,
- onToggleChanged: React.PropTypes.func.isRequired
+ checked: React.PropTypes.bool.isRequired,
+ onToggle: React.PropTypes.func.isRequired,
+ text: React.PropTypes.string.isRequired
};
export class ToggleInputButton extends React.Component {