From fb06c664379fc009c68dc780120fe600cd74cf5f Mon Sep 17 00:00:00 2001
From: cle1000 <cle1000.cb@gmail.com>
Date: Wed, 8 Feb 2017 21:09:03 +0100
Subject: remove contentview selector and view description if edit mode is on

---
 web/src/js/components/ContentView/ViewSelector.jsx | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

(limited to 'web/src/js/components/ContentView/ViewSelector.jsx')

diff --git a/web/src/js/components/ContentView/ViewSelector.jsx b/web/src/js/components/ContentView/ViewSelector.jsx
index fcdc3ee3..43a53995 100644
--- a/web/src/js/components/ContentView/ViewSelector.jsx
+++ b/web/src/js/components/ContentView/ViewSelector.jsx
@@ -1,6 +1,5 @@
 import React, { PropTypes, Component } from 'react'
 import { connect } from 'react-redux'
-import * as ContentViews from './ContentViews'
 import { setContentView } from '../../ducks/ui/flow';
 import Dropdown from '../common/Dropdown'
 
@@ -8,27 +7,20 @@ import Dropdown from '../common/Dropdown'
 ViewSelector.propTypes = {
     contentViews: PropTypes.array.isRequired,
     activeView: PropTypes.string.isRequired,
-    isEdit: PropTypes.bool.isRequired,
     setContentView: PropTypes.func.isRequired
 }
 
-function ViewSelector ({contentViews, activeView, isEdit, setContentView}){
-    let edit = ContentViews.Edit.displayName
-    let inner = <span> <b>View:</b> {activeView} <span className="caret"></span> </span>
+function ViewSelector ({contentViews, activeView, setContentView}){
+    let inner = <span> <b>View:</b> {activeView.toLowerCase()} <span className="caret"></span> </span>
 
     return (
         <Dropdown dropup className="pull-left" btnClass="btn btn-default btn-xs" text={inner}>
             {contentViews.map(name =>
-                <a href="#" key={name} onClick={e => {e.preventDefault(); setContentView(name)}}>
+                <a href="#" key={name}  onClick={e => {e.preventDefault(); setContentView(name)}}>
                     {name.toLowerCase().replace('_', ' ')}
                 </a>
                 )
             }
-            {isEdit &&
-                <a href="#" onClick={e => {e.preventDefault(); setContentView(edit)}}>
-                    {edit.toLowerCase()}
-                </a>
-            }
         </Dropdown>
     )
 }
@@ -37,7 +29,6 @@ export default connect (
     state => ({
         contentViews: state.settings.contentViews,
         activeView: state.ui.flow.contentView,
-        isEdit: !!state.ui.flow.modifiedFlow,
     }), {
         setContentView,
     }
-- 
cgit v1.2.3

