aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/footer.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-03-07 17:58:27 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-03-07 17:58:27 +0100
commitea3742c3938248c273be159d15ac49b4d2884ed8 (patch)
treed128af8eb295ed29f76793514624078f7c0d0b46 /web/src/js/components/footer.js
parent34d19cf12e72a50b1d2e6fd1977c559ed9a80068 (diff)
parentca9a493a1c20651d111ab06f43437d97b7104705 (diff)
downloadmitmproxy-ea3742c3938248c273be159d15ac49b4d2884ed8.tar.gz
mitmproxy-ea3742c3938248c273be159d15ac49b4d2884ed8.tar.bz2
mitmproxy-ea3742c3938248c273be159d15ac49b4d2884ed8.zip
Merge pull request #1009 from gzzhanghao/settings
[web] eliminate SettingsState
Diffstat (limited to 'web/src/js/components/footer.js')
-rw-r--r--web/src/js/components/footer.js31
1 files changed, 16 insertions, 15 deletions
diff --git a/web/src/js/components/footer.js b/web/src/js/components/footer.js
index 415c2577..e2d96288 100644
--- a/web/src/js/components/footer.js
+++ b/web/src/js/components/footer.js
@@ -1,19 +1,20 @@
import React from "react";
import {SettingsState} from "./common.js";
-var Footer = React.createClass({
- mixins: [SettingsState],
- render: function () {
- var mode = this.state.settings.mode;
- var intercept = this.state.settings.intercept;
- return (
- <footer>
- {mode && mode != "regular" ? <span className="label label-success">{mode} mode</span> : null}
- &nbsp;
- {intercept ? <span className="label label-success">Intercept: {intercept}</span> : null}
- </footer>
- );
- }
-});
+Footer.propTypes = {
+ settings: React.PropTypes.object.isRequired,
+};
-export default Footer; \ No newline at end of file
+export default function Footer({ settings }) {
+ const {mode, intercept} = settings;
+ return (
+ <footer>
+ {mode && mode != "regular" && (
+ <span className="label label-success">{mode} mode</span>
+ )}
+ {intercept && (
+ <span className="label label-success">Intercept: {intercept}</span>
+ )}
+ </footer>
+ );
+}