diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-08-13 10:27:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-13 10:27:53 -0700 |
commit | b39c6e08832cecedc95047b00280c2240461f83b (patch) | |
tree | d6230b65e9f487568f0714bc940af2f13183a39c /web/src/js/components/ContentView.jsx | |
parent | 9da55e20477f10155fb79ba66fdc21cca760e40d (diff) | |
parent | 8b43972b95f002e8a5d8a85b7a53f43f16711362 (diff) | |
download | mitmproxy-b39c6e08832cecedc95047b00280c2240461f83b.tar.gz mitmproxy-b39c6e08832cecedc95047b00280c2240461f83b.tar.bz2 mitmproxy-b39c6e08832cecedc95047b00280c2240461f83b.zip |
Merge pull request #1441 from mitmproxy/integrate_mitmproxy_contentviews
Integrate mitmproxy contentviews
Diffstat (limited to 'web/src/js/components/ContentView.jsx')
-rw-r--r-- | web/src/js/components/ContentView.jsx | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/web/src/js/components/ContentView.jsx b/web/src/js/components/ContentView.jsx index 75662509..398438ab 100644 --- a/web/src/js/components/ContentView.jsx +++ b/web/src/js/components/ContentView.jsx @@ -2,11 +2,10 @@ import React, { Component, PropTypes } from 'react' import { connect } from 'react-redux' import * as ContentViews from './ContentView/ContentViews' import * as MetaViews from './ContentView/MetaViews' -import ViewSelector from './ContentView/ViewSelector' -import UploadContentButton from './ContentView/UploadContentButton' -import DownloadContentButton from './ContentView/DownloadContentButton' +import ShowFullContentButton from './ContentView/ShowFullContentButton' -import { setContentView, displayLarge, updateEdit } from '../ducks/ui/flow' + +import { displayLarge, updateEdit } from '../ducks/ui/flow' ContentView.propTypes = { // It may seem a bit weird at the first glance: @@ -19,7 +18,7 @@ ContentView.propTypes = { ContentView.isContentTooLarge = msg => msg.contentLength > 1024 * 1024 * (ContentViews.ViewImage.matches(msg) ? 10 : 0.2) function ContentView(props) { - const { flow, message, contentView, isDisplayLarge, displayLarge, uploadContent, onContentChange, readonly } = props + const { flow, message, contentView, isDisplayLarge, displayLarge, onContentChange, readonly } = props if (message.contentLength === 0 && readonly) { return <MetaViews.ContentEmpty {...props}/> @@ -33,18 +32,11 @@ function ContentView(props) { return <MetaViews.ContentTooLarge {...props} onClick={displayLarge}/> } - const View = ContentViews[contentView] + const View = ContentViews[contentView] || ContentViews['ViewServer'] return ( - <div> - <View flow={flow} message={message} readonly={readonly} onChange={onContentChange}/> - - <div className="view-options text-center"> - <ViewSelector message={message}/> - - <DownloadContentButton flow={flow} message={message}/> - - <UploadContentButton uploadContent={uploadContent}/> - </div> + <div className="contentview"> + <View flow={flow} message={message} contentView={contentView} readonly={readonly} onChange={onContentChange}/> + <ShowFullContentButton/> </div> ) } |