You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.js 1000B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import {
  2. CLOSE_PANEL,
  3. SET_VISIBLE_PANEL,
  4. TOGGLE_CHAT
  5. } from './actionTypes';
  6. /**
  7. * Dispatches an action to close the currently displayed side panel.
  8. *
  9. * @returns {Function}
  10. */
  11. export function closePanel() {
  12. return (dispatch, getState) => {
  13. dispatch({
  14. type: CLOSE_PANEL,
  15. current: getState()['features/side-panel'].current
  16. });
  17. };
  18. }
  19. /**
  20. * Updates the redux store with the currently displayed side panel.
  21. *
  22. * @param {string|null} name - The name of the side panel being displayed. Null
  23. * (or falsy) should be set if no side panel is being displayed.
  24. * @returns {{
  25. * type: SET_VISIBLE_PANEL,
  26. * current: string
  27. * }}
  28. */
  29. export function setVisiblePanel(name = null) {
  30. return {
  31. type: SET_VISIBLE_PANEL,
  32. current: name
  33. };
  34. }
  35. /**
  36. * Toggles display of the chat side panel.
  37. *
  38. * @returns {{
  39. * type: TOGGLE_CHAT
  40. * }}
  41. */
  42. export function toggleChat() {
  43. return {
  44. type: TOGGLE_CHAT
  45. };
  46. }