diff options
author | Matthew Shao <me@matshao.com> | 2017-06-28 21:48:22 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2017-06-28 21:48:22 +0800 |
commit | febfeb9ef2bd9c412590c489e12f393f183b9a82 (patch) | |
tree | bbf7109a56be42e7db9c9e9be94eef718a9b3b3f /web/src/js | |
parent | 81c854e9097b9d8990899b41a1ac8f7050182763 (diff) | |
download | mitmproxy-febfeb9ef2bd9c412590c489e12f393f183b9a82.tar.gz mitmproxy-febfeb9ef2bd9c412590c489e12f393f183b9a82.tar.bz2 mitmproxy-febfeb9ef2bd9c412590c489e12f393f183b9a82.zip |
[web] Minor update for Modal Component.
Diffstat (limited to 'web/src/js')
-rw-r--r-- | web/src/js/components/Header/FileMenu.jsx | 4 | ||||
-rw-r--r-- | web/src/js/components/Modal/Modal.jsx | 2 | ||||
-rw-r--r-- | web/src/js/components/Modal/ModalList.jsx | 2 | ||||
-rw-r--r-- | web/src/js/components/ProxyApp.jsx | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/web/src/js/components/Header/FileMenu.jsx b/web/src/js/components/Header/FileMenu.jsx index 82855c43..62f721cf 100644 --- a/web/src/js/components/Header/FileMenu.jsx +++ b/web/src/js/components/Header/FileMenu.jsx @@ -36,7 +36,7 @@ export function FileMenu ({clearFlows, loadFlows, saveFlows, openModal}) { Save... </a> - <a href="#" onClick={e => { openModal('OptionModal') }}> + <a href="#" onClick={e => { e.preventDefault(); openModal(); }}> <i className="fa fa-fw fa-cog"></i> Options </a> @@ -57,6 +57,6 @@ export default connect( clearFlows: flowsActions.clear, loadFlows: flowsActions.upload, saveFlows: flowsActions.download, - openModal: modalActions.setActiveModal, + openModal: () => modalActions.setActiveModal('OptionModal'), } )(FileMenu) diff --git a/web/src/js/components/Modal/Modal.jsx b/web/src/js/components/Modal/Modal.jsx index 3370ad36..e39f5415 100644 --- a/web/src/js/components/Modal/Modal.jsx +++ b/web/src/js/components/Modal/Modal.jsx @@ -11,7 +11,7 @@ class PureModal extends Component { render() { const { activeModal, hideModal } = this.props - const ActiveModal = _.find(ModalList, m => m.name === activeModal ) + const ActiveModal = ModalList.find(m => m.name === activeModal ) return( activeModal ? <div> diff --git a/web/src/js/components/Modal/ModalList.jsx b/web/src/js/components/Modal/ModalList.jsx index 41b36f00..8ba46b00 100644 --- a/web/src/js/components/Modal/ModalList.jsx +++ b/web/src/js/components/Modal/ModalList.jsx @@ -1,3 +1,3 @@ import OptionModal from './OptionModal' -export default [ OptionModal, EmptyModal ] +export default [ OptionModal ] diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx index af5b3caa..8c3970bc 100644 --- a/web/src/js/components/ProxyApp.jsx +++ b/web/src/js/components/ProxyApp.jsx @@ -7,6 +7,7 @@ import MainView from './MainView' import Header from './Header' import EventLog from './EventLog' import Footer from './Footer' +import Modal from './Modal/Modal' class ProxyAppMain extends Component { @@ -28,6 +29,7 @@ class ProxyAppMain extends Component { <EventLog key="eventlog"/> )} <Footer /> + <Modal/> </div> ) } |