From 2c5068727997d4b223e74e765df75d9773b954f7 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Sun, 26 Feb 2017 01:23:44 +0100
Subject: Improve compose form performance, upgrade JS dependencies.
 LightingBox now allows to cycle through multiple images

---
 .../compose/containers/sensitive_toggle_container.jsx  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 app/assets/javascripts/components/features/compose/containers/sensitive_toggle_container.jsx

(limited to 'app/assets/javascripts/components/features/compose/containers/sensitive_toggle_container.jsx')

diff --git a/app/assets/javascripts/components/features/compose/containers/sensitive_toggle_container.jsx b/app/assets/javascripts/components/features/compose/containers/sensitive_toggle_container.jsx
new file mode 100644
index 000000000..97b3361ba
--- /dev/null
+++ b/app/assets/javascripts/components/features/compose/containers/sensitive_toggle_container.jsx
@@ -0,0 +1,18 @@
+import { connect } from 'react-redux';
+import SensitiveToggle from '../components/sensitive_toggle';
+import { changeComposeSensitivity } from '../../../actions/compose';
+
+const mapStateToProps = state => ({
+  hasMedia: state.getIn(['compose', 'media_attachments']).size > 0,
+  isSensitive: state.getIn(['compose', 'sensitive'])
+});
+
+const mapDispatchToProps = dispatch => ({
+
+  onChange (e) {
+    dispatch(changeComposeSensitivity(e.target.checked));
+  }
+
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(SensitiveToggle);
-- 
cgit 

