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/OptionMenu.jsx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

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

diff --git a/web/src/js/components/Header/OptionMenu.jsx b/web/src/js/components/Header/OptionMenu.jsx
index b33d578d..566db42f 100644
--- a/web/src/js/components/Header/OptionMenu.jsx
+++ b/web/src/js/components/Header/OptionMenu.jsx
@@ -3,21 +3,23 @@ import PropTypes from 'prop-types'
 import { connect } from "react-redux"
 import { SettingsToggle, EventlogToggle } from "./MenuToggle"
 import DocsLink from "../common/DocsLink"
+import HideInStatic from "../common/HideInStatic";
 
 OptionMenu.title = 'Options'
 
 export default function OptionMenu() {
     return (
         <div>
-            <div className="menu-group">
+            <HideInStatic className="menu-group">
                 <div className="menu-content">
                     <SettingsToggle setting="http2">HTTP/2.0</SettingsToggle>
                     <SettingsToggle setting="websocket">WebSockets</SettingsToggle>
                     <SettingsToggle setting="rawtcp">Raw TCP</SettingsToggle>
                 </div>
                 <div className="menu-legend">Protocol Support</div>
-            </div>
-            <div className="menu-group">
+            </HideInStatic>
+
+            <HideInStatic className="menu-group">
                 <div className="menu-content">
                     <SettingsToggle setting="anticache">
                         Disable Caching <DocsLink resource="features/anticache.html"/>
@@ -28,13 +30,17 @@ export default function OptionMenu() {
                     </SettingsToggle>
                 </div>
                 <div className="menu-legend">HTTP Options</div>
-            </div>
+            </HideInStatic>
+
             <div className="menu-group">
                 <div className="menu-content">
+                    <HideInStatic>
                     <SettingsToggle setting="showhost">
                         Use Host Header <i className="fa fa-question-circle"
                                            title="Use the Host header to construct URLs for display."></i>
                     </SettingsToggle>
+                    </HideInStatic>
+
                     <EventlogToggle/>
                 </div>
                 <div className="menu-legend">View Options</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/OptionMenu.jsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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

diff --git a/web/src/js/components/Header/OptionMenu.jsx b/web/src/js/components/Header/OptionMenu.jsx
index 566db42f..78519a34 100644
--- a/web/src/js/components/Header/OptionMenu.jsx
+++ b/web/src/js/components/Header/OptionMenu.jsx
@@ -10,16 +10,19 @@ OptionMenu.title = 'Options'
 export default function OptionMenu() {
     return (
         <div>
-            <HideInStatic className="menu-group">
+            <HideInStatic>
+            <div className="menu-group">
                 <div className="menu-content">
                     <SettingsToggle setting="http2">HTTP/2.0</SettingsToggle>
                     <SettingsToggle setting="websocket">WebSockets</SettingsToggle>
                     <SettingsToggle setting="rawtcp">Raw TCP</SettingsToggle>
                 </div>
                 <div className="menu-legend">Protocol Support</div>
+            </div>
             </HideInStatic>
 
-            <HideInStatic className="menu-group">
+            <HideInStatic>
+            <div className="menu-group">
                 <div className="menu-content">
                     <SettingsToggle setting="anticache">
                         Disable Caching <DocsLink resource="features/anticache.html"/>
@@ -30,6 +33,7 @@ export default function OptionMenu() {
                     </SettingsToggle>
                 </div>
                 <div className="menu-legend">HTTP Options</div>
+            </div>
             </HideInStatic>
 
             <div className="menu-group">
-- 
cgit v1.2.3


From 0ad552ead46ae501b8af0a28820aad40b927cba7 Mon Sep 17 00:00:00 2001
From: Matthew Shao <me@matshao.com>
Date: Tue, 8 Aug 2017 22:46:47 +0800
Subject: [web] Minor fixes.

---
 web/src/js/components/Header/OptionMenu.jsx | 2 --
 1 file changed, 2 deletions(-)

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

diff --git a/web/src/js/components/Header/OptionMenu.jsx b/web/src/js/components/Header/OptionMenu.jsx
index 78519a34..c41c9d99 100644
--- a/web/src/js/components/Header/OptionMenu.jsx
+++ b/web/src/js/components/Header/OptionMenu.jsx
@@ -19,9 +19,7 @@ export default function OptionMenu() {
                 </div>
                 <div className="menu-legend">Protocol Support</div>
             </div>
-            </HideInStatic>
 
-            <HideInStatic>
             <div className="menu-group">
                 <div className="menu-content">
                     <SettingsToggle setting="anticache">
-- 
cgit v1.2.3

