From 9b0b007a5da75d70ec25b141c2a47b1b0010f5a3 Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 5 Aug 2016 12:47:34 +0200 Subject: [PATCH] change some style --- web/src/css/flowdetail.less | 31 ++++-- web/src/js/components/ContentView.jsx | 18 +--- .../ContentView/ContentViewOptions.jsx | 31 ++++++ .../components/ContentView/ContentViews.jsx | 13 +-- web/src/js/components/FlowView.jsx | 2 +- web/src/js/components/FlowView/Messages.jsx | 94 +++++++++++-------- 6 files changed, 120 insertions(+), 69 deletions(-) create mode 100644 web/src/js/components/ContentView/ContentViewOptions.jsx diff --git a/web/src/css/flowdetail.less b/web/src/css/flowdetail.less index b4c7047b9..421630eba 100644 --- a/web/src/css/flowdetail.less +++ b/web/src/css/flowdetail.less @@ -5,8 +5,7 @@ .flow-detail { width: 100%; - overflow-x: auto; - overflow-y: scroll; + overflow:hidden; nav { background-color: #F2F2F2; @@ -41,6 +40,28 @@ } +.flowview-container{ + display: flex; + flex-direction: column; + padding: 0 !important; + height:95%; +} + +.flowview-body{ + position:relative; + flex: 1 1 auto; + overflow: auto; + padding: 5px 12px 0; +} + +.flowview-footer{ + flex: 0 0 auto; + box-shadow: 0 0 3px gray; + padding: 2px; + margin: 0; + height:23px; +} + .inline-input { display: inline; margin: 0 -3px; @@ -64,13 +85,9 @@ } } -.view-options { - margin-bottom: 10px; - margin-top: 10px; -} - .view-all-content-btn{ float: right; + margin-bottom: 12px; } .flow-detail table { diff --git a/web/src/js/components/ContentView.jsx b/web/src/js/components/ContentView.jsx index 128d8e81a..398438ab5 100644 --- a/web/src/js/components/ContentView.jsx +++ b/web/src/js/components/ContentView.jsx @@ -2,12 +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: @@ -20,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, contentViewDescription } = props + const { flow, message, contentView, isDisplayLarge, displayLarge, onContentChange, readonly } = props if (message.contentLength === 0 && readonly) { return @@ -39,15 +37,6 @@ function ContentView(props) {
-
- -   - -   - -   - {contentViewDescription} -
) } @@ -56,7 +45,6 @@ export default connect( state => ({ contentView: state.ui.flow.contentView, isDisplayLarge: state.ui.flow.displayLarge, - contentViewDescription: state.ui.flow.viewDescription }), { displayLarge, diff --git a/web/src/js/components/ContentView/ContentViewOptions.jsx b/web/src/js/components/ContentView/ContentViewOptions.jsx new file mode 100644 index 000000000..fed3a088b --- /dev/null +++ b/web/src/js/components/ContentView/ContentViewOptions.jsx @@ -0,0 +1,31 @@ +import React, { PropTypes } from 'react' +import { connect } from 'react-redux' +import ViewSelector from './ViewSelector' +import UploadContentButton from './UploadContentButton' +import DownloadContentButton from './DownloadContentButton' + +ContentViewOptions.propTypes = { + flow: React.PropTypes.object.isRequired, + message: React.PropTypes.object.isRequired, +} + +function ContentViewOptions(props) { + const { flow, message, uploadContent, readonly, contentViewDescription } = props + return ( +
+ +   + +   + +   + {contentViewDescription} +
+ ) +} + +export default connect( + state => ({ + contentViewDescription: state.ui.flow.viewDescription + }) +)(ContentViewOptions) diff --git a/web/src/js/components/ContentView/ContentViews.jsx b/web/src/js/components/ContentView/ContentViews.jsx index 43aece468..3db77af48 100644 --- a/web/src/js/components/ContentView/ContentViews.jsx +++ b/web/src/js/components/ContentView/ContentViews.jsx @@ -30,9 +30,8 @@ function Edit({ content, onChange }) { Edit = ContentLoader(Edit) class ViewServer extends Component { - constructor(props){ - super(props) - this.maxLines = 80 + static defaultProps = { + maxLines: 80, } componentWillMount(){ @@ -50,14 +49,12 @@ class ViewServer extends Component { props.setContentViewDescription(props.contentView != this.data.description ? this.data.description : '') - let isFullContentShown = this.data.lines.length < this.maxLines + let isFullContentShown = this.data.lines.length < props.maxLines if (isFullContentShown) props.setShowFullContent(true) } render() { - const {content, contentView, message} = this.props - - let lines = this.props.showFullContent ? this.data.lines : this.data.lines.slice(0, this.maxLines) - + const {content, contentView, message, maxLines} = this.props + let lines = this.props.showFullContent ? this.data.lines : this.data.lines.slice(0, maxLines) return
                     {lines.map((line, i) =>
diff --git a/web/src/js/components/FlowView.jsx b/web/src/js/components/FlowView.jsx
index a80dc0407..72cffdfe9 100644
--- a/web/src/js/components/FlowView.jsx
+++ b/web/src/js/components/FlowView.jsx
@@ -71,7 +71,7 @@ export default class FlowView extends Component {
         const Tab = FlowView.allTabs[_.capitalize(active)]
 
         return (
-            
+