From 6c95635cb809d9261acc317f223ef80ba9c25f20 Mon Sep 17 00:00:00 2001
From: Jason <jason.daurus@gmail.com>
Date: Thu, 9 Jun 2016 18:40:59 +0800
Subject: [web] eventlog.js -> EventLog.jsx

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

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

diff --git a/web/src/js/components/EventLog.jsx b/web/src/js/components/EventLog.jsx
new file mode 100644
index 00000000..3de38954
--- /dev/null
+++ b/web/src/js/components/EventLog.jsx
@@ -0,0 +1,41 @@
+import React, { PropTypes } from 'react'
+import { bindActionCreators } from 'redux'
+import { connect } from 'react-redux'
+import { toggleEventLogFilter, toggleEventLogVisibility } from '../ducks/eventLog'
+import { ToggleButton } from './common'
+import EventList from './EventLog/EventList'
+
+EventLog.propTypes = {
+    filters: PropTypes.object.isRequired,
+    events: PropTypes.array.isRequired,
+    onToggleFilter: PropTypes.func.isRequired,
+    onClose: PropTypes.func.isRequired
+}
+
+function EventLog({ filters, events, onToggleFilter, onClose }) {
+    return (
+        <div className="eventlog">
+            <div>
+                Eventlog
+                <div className="pull-right">
+                    {['debug', 'info', 'web'].map(type => (
+                        <ToggleButton text={type} checked={filters[type]} onToggle={() => onToggleFilter(type)}/>
+                    ))}
+                    <i onClick={onClose} className="fa fa-close"></i>
+                </div>
+            </div>
+            <EventList events={events} />
+        </div>
+    )
+}
+
+export default connect(
+    state => ({
+        filters: state.eventLog.filter,
+        events: state.eventLog.filteredEvents,
+    }),
+    dispatch => bindActionCreators({
+        onClose: toggleEventLogVisibility,
+        onToggleFilter: toggleEventLogFilter,
+    }, dispatch)
+)(EventLog)
-- 
cgit v1.2.3


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/EventLog.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/web/src/js/components/EventLog.jsx b/web/src/js/components/EventLog.jsx
index 3de38954..24b3c2bf 100644
--- a/web/src/js/components/EventLog.jsx
+++ b/web/src/js/components/EventLog.jsx
@@ -19,7 +19,7 @@ function EventLog({ filters, events, onToggleFilter, onClose }) {
                 Eventlog
                 <div className="pull-right">
                     {['debug', 'info', 'web'].map(type => (
-                        <ToggleButton text={type} checked={filters[type]} onToggle={() => onToggleFilter(type)}/>
+                        <ToggleButton key={type} text={type} checked={filters[type]} onToggle={() => onToggleFilter(type)}/>
                     ))}
                     <i onClick={onClose} className="fa fa-close"></i>
                 </div>
-- 
cgit v1.2.3

