about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/edited_timestamp/containers/dropdown_menu_container.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/flavours/glitch/components/edited_timestamp/containers/dropdown_menu_container.js')
-rw-r--r--app/javascript/flavours/glitch/components/edited_timestamp/containers/dropdown_menu_container.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/containers/dropdown_menu_container.js b/app/javascript/flavours/glitch/components/edited_timestamp/containers/dropdown_menu_container.js
new file mode 100644
index 000000000..a1519757d
--- /dev/null
+++ b/app/javascript/flavours/glitch/components/edited_timestamp/containers/dropdown_menu_container.js
@@ -0,0 +1,26 @@
+import { connect } from 'react-redux';
+import { openDropdownMenu, closeDropdownMenu } from 'flavours/glitch/actions/dropdown_menu';
+import { fetchHistory } from 'flavours/glitch/actions/history';
+import DropdownMenu from 'flavours/glitch/components/dropdown_menu';
+
+const mapStateToProps = (state, { statusId }) => ({
+  openDropdownId: state.getIn(['dropdown_menu', 'openId']),
+  openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),
+  items: state.getIn(['history', statusId, 'items']),
+  loading: state.getIn(['history', statusId, 'loading']),
+});
+
+const mapDispatchToProps = (dispatch, { statusId }) => ({
+
+  onOpen (id, onItemClick, keyboard) {
+    dispatch(fetchHistory(statusId));
+    dispatch(openDropdownMenu(id, keyboard));
+  },
+
+  onClose (id) {
+    dispatch(closeDropdownMenu(id));
+  },
+
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(DropdownMenu);