about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-04-20 22:21:28 +0200
committerThibG <thib@sitedethib.com>2019-04-22 20:15:47 +0200
commit8fd599fb40a5a078f26b5f450d88cf12609d9c14 (patch)
tree2c48fc6800a33f754e21cb85a2d1886b85bc13f5 /app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js
parentf72af5794da52d22fbb2a77e0fcbc111633fcab2 (diff)
ComposerReply → ReplyIndicator
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js')
-rw-r--r--app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js b/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js
new file mode 100644
index 000000000..395a9aa5b
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js
@@ -0,0 +1,22 @@
+import { connect } from 'react-redux';
+import { cancelReplyCompose } from 'flavours/glitch/actions/compose';
+import { makeGetStatus } from 'flavours/glitch/selectors';
+import ReplyIndicator from '../components/reply_indicator';
+
+function makeMapStateToProps (state) {
+  const inReplyTo = state.getIn(['compose', 'in_reply_to']);
+
+  return {
+    status: inReplyTo ? state.getIn(['statuses', inReplyTo]) : null,
+  };
+};
+
+const mapDispatchToProps = dispatch => ({
+
+  onCancel () {
+    dispatch(cancelReplyCompose());
+  },
+
+});
+
+export default connect(makeMapStateToProps, mapDispatchToProps)(ReplyIndicator);