diff options
author | Jason <jason.daurus@gmail.com> | 2016-03-08 00:57:01 +0800 |
---|---|---|
committer | Jason <jason.daurus@gmail.com> | 2016-03-08 00:57:01 +0800 |
commit | ca9a493a1c20651d111ab06f43437d97b7104705 (patch) | |
tree | d128af8eb295ed29f76793514624078f7c0d0b46 | |
parent | 0545326dc0319923c0746af0dd0746e98528c39c (diff) | |
download | mitmproxy-ca9a493a1c20651d111ab06f43437d97b7104705.tar.gz mitmproxy-ca9a493a1c20651d111ab06f43437d97b7104705.tar.bz2 mitmproxy-ca9a493a1c20651d111ab06f43437d97b7104705.zip |
[web] uniform code style for Footer component
-rw-r--r-- | mitmproxy/web/static/app.js | 11 | ||||
-rw-r--r-- | web/src/js/components/footer.js | 12 |
2 files changed, 12 insertions, 11 deletions
diff --git a/mitmproxy/web/static/app.js b/mitmproxy/web/static/app.js index 997d8ed4..bb06970e 100644 --- a/mitmproxy/web/static/app.js +++ b/mitmproxy/web/static/app.js @@ -2767,25 +2767,24 @@ Footer.propTypes = { function Footer(_ref) { var settings = _ref.settings; - var mode = settings.mode; var intercept = settings.intercept; + return _react2.default.createElement( "footer", null, - mode && mode != "regular" ? _react2.default.createElement( + mode && mode != "regular" && _react2.default.createElement( "span", { className: "label label-success" }, mode, " mode" - ) : null, - " ", - intercept ? _react2.default.createElement( + ), + intercept && _react2.default.createElement( "span", { className: "label label-success" }, "Intercept: ", intercept - ) : null + ) ); } diff --git a/web/src/js/components/footer.js b/web/src/js/components/footer.js index 7d313b02..e2d96288 100644 --- a/web/src/js/components/footer.js +++ b/web/src/js/components/footer.js @@ -6,13 +6,15 @@ Footer.propTypes = { }; export default function Footer({ settings }) { - const mode = settings.mode; - const intercept = settings.intercept; + const {mode, intercept} = settings; return ( <footer> - {mode && mode != "regular" ? <span className="label label-success">{mode} mode</span> : null} - - {intercept ? <span className="label label-success">Intercept: {intercept}</span> : null} + {mode && mode != "regular" && ( + <span className="label label-success">{mode} mode</span> + )} + {intercept && ( + <span className="label label-success">Intercept: {intercept}</span> + )} </footer> ); } |