From d1c7b203f08d4b1e1ee3c7a50762a4f08843feef Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 11 Dec 2016 19:59:54 +0100 Subject: [PATCH] [web] style flow menu --- web/src/css/header.less | 74 +++++++++++------ web/src/js/components/Header/FlowMenu.jsx | 62 +++++++++++--- web/src/js/components/Header/MenuToggle.jsx | 2 +- web/src/js/components/Header/OptionMenu.jsx | 92 +++++++++++---------- web/src/js/components/common/Button.jsx | 16 ++-- 5 files changed, 159 insertions(+), 87 deletions(-) diff --git a/web/src/css/header.less b/web/src/css/header.less index c90e91c43..a026d8aac 100644 --- a/web/src/css/header.less +++ b/web/src/css/header.less @@ -3,7 +3,6 @@ @menu-height: 85px; - header { padding-top: 6px; background-color: white; @@ -18,35 +17,62 @@ header { } } +@menu-legend-height: 16px; +@menu-group-hmargin: 3px; .menu-group { - @description-height: 16px; + margin: 0 @menu-group-hmargin; display: inline-block; height: @menu-height; vertical-align: top; +} - .entry { - height: (@menu-height - @description-height)/3; - line-height: 1; - padding: 0.5rem 1rem; +.menu-content { + height: @menu-height - @menu-legend-height; + text-align: center; - label { - font-size: 1.2rem; - font-weight: normal; - margin: 0; - } - input[type=checkbox] { - margin: 0 2px; - vertical-align: middle; - } - } - .description { - height: @description-height; + > .btn { + height: @menu-height - @menu-legend-height; text-align: center; - font-size: 0.9rem; + margin: 0 1px; + padding: 12px 5px; + border: none; + border-radius: 0; + i { + font-size: 20px; + display: block; + margin: 0 auto 5px; + } } } + + +.menu-entry { + height: (@menu-height - @menu-legend-height)/3; + line-height: 1; + padding: 0.5rem 1rem; + + label { + font-size: 1.2rem; + font-weight: normal; + margin: 0; + } + input[type=checkbox] { + margin: 0 2px; + vertical-align: middle; + } +} + + +.menu-legend { + height: @menu-legend-height; + text-align: center; + font-size: 12px; + padding: 0 5px; +} + .menu-group + .menu-group:before { @space: 10px; + margin-left: -@menu-group-hmargin; content: " "; border-left: solid 1px lighten(grey, 40%); margin-top: @space; @@ -68,11 +94,11 @@ header { padding: 2px 2.5px; - >.form-control,> .input-group-addon, > .input-group-btn>.btn { - height: 23.5px; - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; + > .form-control, > .input-group-addon, > .input-group-btn > .btn { + height: 23.5px; + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; } } } diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx index e0c59afeb..420cb0547 100644 --- a/web/src/js/components/Header/FlowMenu.jsx +++ b/web/src/js/components/Header/FlowMenu.jsx @@ -1,13 +1,13 @@ -import React, { PropTypes } from 'react' -import { connect } from 'react-redux' -import Button from '../common/Button' -import { MessageUtils } from '../../flow/utils.js' -import * as flowsActions from '../../ducks/flows' +import React, { PropTypes } from "react" +import { connect } from "react-redux" +import Button from "../common/Button" +import { MessageUtils } from "../../flow/utils.js" +import * as flowsActions from "../../ducks/flows" FlowMenu.title = 'Flow' FlowMenu.propTypes = { - flow: PropTypes.object.isRequired, + flow: PropTypes.object, acceptFlow: PropTypes.func.isRequired, replayFlow: PropTypes.func.isRequired, duplicateFlow: PropTypes.func.isRequired, @@ -16,14 +16,52 @@ FlowMenu.propTypes = { } function FlowMenu({ flow, acceptFlow, replayFlow, duplicateFlow, removeFlow, revertFlow }) { + if (!flow) + return
return (
- + + + +
+
Flow Modification
+
+
+
+ +
+
Export
+
+
+
+ + +
+
Interception
+
+ + + ) } diff --git a/web/src/js/components/Header/MenuToggle.jsx b/web/src/js/components/Header/MenuToggle.jsx index 726db7bd1..8977f3b90 100644 --- a/web/src/js/components/Header/MenuToggle.jsx +++ b/web/src/js/components/Header/MenuToggle.jsx @@ -11,7 +11,7 @@ MenuToggle.propTypes = { export function MenuToggle({ value, onChange, children }) { return ( -
+