From 81a0c45c89df2dc94f7d97c4367f0e549495e4d0 Mon Sep 17 00:00:00 2001
From: Jason <jason.daurus@gmail.com>
Date: Thu, 9 Jun 2016 20:34:57 +0800
Subject: [web] header.js -> Header.js

---
 web/src/js/components/Header/ViewMenu.jsx | 33 +++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 web/src/js/components/Header/ViewMenu.jsx

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

diff --git a/web/src/js/components/Header/ViewMenu.jsx b/web/src/js/components/Header/ViewMenu.jsx
new file mode 100644
index 00000000..45359a83
--- /dev/null
+++ b/web/src/js/components/Header/ViewMenu.jsx
@@ -0,0 +1,33 @@
+import React, { PropTypes } from 'react'
+import { bindActionCreators } from 'redux'
+import { connect } from 'react-redux'
+import { ToggleButton } from '../common.js'
+import { toggleEventLogVisibility } from '../../ducks/eventLog'
+
+ViewMenu.title = 'View'
+ViewMenu.route = 'flows'
+
+ViewMenu.propTypes = {
+    visible: PropTypes.bool.isRequired,
+    onToggle: PropTypes.func.isRequired,
+}
+
+function ViewMenu({ visible, onToggle }) {
+    return (
+        <div>
+            <div className="menu-row">
+                <ToggleButton text="Show Event Log" checked={visible} onToggle={onToggle} />
+            </div>
+            <div className="clearfix"></div>
+        </div>
+    )
+}
+
+export default connect(
+    state => ({
+        visible: state.eventLog.visible,
+    }),
+    dispatch => bindActionCreators({
+        onToggle: toggleEventLogVisibility,
+    }, dispatch)
+)(ViewMenu)
-- 
cgit v1.2.3

