aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/ContentView/ShowFullContentButton.jsx
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-08-13 10:27:53 -0700
committerGitHub <noreply@github.com>2016-08-13 10:27:53 -0700
commitb39c6e08832cecedc95047b00280c2240461f83b (patch)
treed6230b65e9f487568f0714bc940af2f13183a39c /web/src/js/components/ContentView/ShowFullContentButton.jsx
parent9da55e20477f10155fb79ba66fdc21cca760e40d (diff)
parent8b43972b95f002e8a5d8a85b7a53f43f16711362 (diff)
downloadmitmproxy-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/ShowFullContentButton.jsx')
-rw-r--r--web/src/js/components/ContentView/ShowFullContentButton.jsx36
1 files changed, 36 insertions, 0 deletions
diff --git a/web/src/js/components/ContentView/ShowFullContentButton.jsx b/web/src/js/components/ContentView/ShowFullContentButton.jsx
new file mode 100644
index 00000000..676068e9
--- /dev/null
+++ b/web/src/js/components/ContentView/ShowFullContentButton.jsx
@@ -0,0 +1,36 @@
+import React, { Component, PropTypes } from 'react'
+import { connect } from 'react-redux'
+import { render } from 'react-dom';
+import Button from '../common/Button';
+import { setShowFullContent } from '../../ducks/ui/flow'
+
+
+
+ShowFullContentButton.propTypes = {
+ setShowFullContent: PropTypes.func.isRequired,
+ showFullContent: PropTypes.bool.isRequired
+}
+
+function ShowFullContentButton ( {setShowFullContent, showFullContent, visibleLines, contentLines} ){
+
+ return (
+ !showFullContent &&
+ <div>
+ <Button className="view-all-content-btn btn-xs" onClick={() => setShowFullContent(true)} text="Show full content"/>
+ <span className="pull-right"> {visibleLines}/{contentLines} are visible &nbsp; </span>
+ </div>
+ )
+}
+
+export default connect(
+ state => ({
+ showFullContent: state.ui.flow.showFullContent,
+ visibleLines: state.ui.flow.maxContentLines,
+ contentLines: state.ui.flow.content.length
+
+ }),
+ {
+ setShowFullContent
+ }
+)(ShowFullContentButton)
+