From f7b494ccf2a90d8c54df760e5142f34f11f8cf3c Mon Sep 17 00:00:00 2001
From: Matthew Shao <me@matshao.com>
Date: Mon, 7 Aug 2017 11:05:02 +0800
Subject: [web] Add HideInStatic Component

HideInStaic compoent will check the MITMWEB_STATIC var, and hide the
responsive components in static mode.
---
 web/src/js/components/Header/FlowMenu.jsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'web/src/js/components/Header/FlowMenu.jsx')

diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
index 8f104213..dc822150 100644
--- a/web/src/js/components/Header/FlowMenu.jsx
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -4,6 +4,7 @@ import { connect } from "react-redux"
 import Button from "../common/Button"
 import { MessageUtils } from "../../flow/utils.js"
 import * as flowsActions from "../../ducks/flows"
+import HideInStatic from "../common/HideInStatic";
 
 FlowMenu.title = 'Flow'
 
@@ -22,7 +23,7 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
         return <div/>
     return (
         <div>
-            <div className="menu-group">
+            <HideInStatic className="menu-group">
                 <div className="menu-content">
                     <Button title="[r]eplay flow" icon="fa-repeat text-primary"
                             onClick={() => replayFlow(flow)}>
@@ -42,7 +43,8 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
                     </Button>
                 </div>
                 <div className="menu-legend">Flow Modification</div>
-            </div>
+            </HideInStatic>
+
             <div className="menu-group">
                 <div className="menu-content">
                     <Button title="download" icon="fa-download"
@@ -52,7 +54,8 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
                 </div>
                 <div className="menu-legend">Export</div>
             </div>
-            <div className="menu-group">
+
+            <HideInStatic className="menu-group">
                 <div className="menu-content">
                     <Button disabled={!flow || !flow.intercepted} title="[a]ccept intercepted flow"
                             icon="fa-play text-success" onClick={() => resumeFlow(flow)}>
@@ -64,7 +67,7 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
                     </Button>
                 </div>
                 <div className="menu-legend">Interception</div>
-            </div>
+            </HideInStatic>
 
 
         </div>
-- 
cgit v1.2.3


From 756b734ae294da09041303be52f9e9ced0b40d2d Mon Sep 17 00:00:00 2001
From: Matthew Shao <me@matshao.com>
Date: Tue, 8 Aug 2017 21:57:42 +0800
Subject: [web] update HideInStatic and some components.

---
 web/src/js/components/Header/FlowMenu.jsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'web/src/js/components/Header/FlowMenu.jsx')

diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
index dc822150..70c8bfcf 100644
--- a/web/src/js/components/Header/FlowMenu.jsx
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -23,7 +23,8 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
         return <div/>
     return (
         <div>
-            <HideInStatic className="menu-group">
+            <HideInStatic>
+            <div className="menu-group">
                 <div className="menu-content">
                     <Button title="[r]eplay flow" icon="fa-repeat text-primary"
                             onClick={() => replayFlow(flow)}>
@@ -43,6 +44,7 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
                     </Button>
                 </div>
                 <div className="menu-legend">Flow Modification</div>
+            </div>
             </HideInStatic>
 
             <div className="menu-group">
@@ -55,7 +57,8 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
                 <div className="menu-legend">Export</div>
             </div>
 
-            <HideInStatic className="menu-group">
+            <HideInStatic>
+            <div className="menu-group">
                 <div className="menu-content">
                     <Button disabled={!flow || !flow.intercepted} title="[a]ccept intercepted flow"
                             icon="fa-play text-success" onClick={() => resumeFlow(flow)}>
@@ -67,6 +70,7 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow
                     </Button>
                 </div>
                 <div className="menu-legend">Interception</div>
+            </div>
             </HideInStatic>
 
 
-- 
cgit v1.2.3

