diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-03-07 17:58:27 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-03-07 17:58:27 +0100 |
commit | ea3742c3938248c273be159d15ac49b4d2884ed8 (patch) | |
tree | d128af8eb295ed29f76793514624078f7c0d0b46 /web/src/js/components/header.js | |
parent | 34d19cf12e72a50b1d2e6fd1977c559ed9a80068 (diff) | |
parent | ca9a493a1c20651d111ab06f43437d97b7104705 (diff) | |
download | mitmproxy-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/header.js')
-rw-r--r-- | web/src/js/components/header.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/web/src/js/components/header.js b/web/src/js/components/header.js index 96b522f0..1af928a3 100644 --- a/web/src/js/components/header.js +++ b/web/src/js/components/header.js @@ -4,7 +4,7 @@ import $ from "jquery"; import Filt from "../filt/filt.js"; import {Key} from "../utils.js"; -import {Router, SettingsState} from "./common.js"; +import {Router} from "./common.js"; import {SettingsActions, FlowActions} from "../actions.js"; import {Query} from "../actions.js"; @@ -161,7 +161,10 @@ var FilterInput = React.createClass({ }); export var MainMenu = React.createClass({ - mixins: [Router, SettingsState], + mixins: [Router], + propTypes: { + settings: React.PropTypes.object.isRequired, + }, statics: { title: "Start", route: "flows" @@ -182,7 +185,7 @@ export var MainMenu = React.createClass({ render: function () { var search = this.getQuery()[Query.SEARCH] || ""; var highlight = this.getQuery()[Query.HIGHLIGHT] || ""; - var intercept = this.state.settings.intercept || ""; + var intercept = this.props.settings.intercept || ""; return ( <div> @@ -351,6 +354,9 @@ var header_entries = [MainMenu, ViewMenu /*, ReportsMenu */]; export var Header = React.createClass({ mixins: [Router], + propTypes: { + settings: React.PropTypes.object.isRequired, + }, getInitialState: function () { return { active: header_entries[0] @@ -386,7 +392,7 @@ export var Header = React.createClass({ {header} </nav> <div className="menu"> - <this.state.active ref="active"/> + <this.state.active ref="active" settings={this.props.settings}/> </div> </header> ); |