// messages
export const SEND_MESSAGE = 'SEND_MESSAGE'
export const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE'
// user
export const UPDATE_USER = 'UPDATE_USER'
export const LOGIN = 'LOGIN'
export const LOGOUT = 'LOGOUT'
// modals
export const SHOW_MODAL = 'SHOW_MODAL'
export const HIDE_MODAL = 'SHOW_MODAL'
// prefs
export const TOGGLE_CHAT_PIN = 'TOGGLE_CHAT_PIN'
export const CHANGE_THEME = 'CHANGE_THEME'
export const RECEIVE_PREFS = 'RECEIVE_PREFS'
// sidebar
export const CHANGE_SIDEBAR_TAB = 'CHANGE_SIDEBAR_TAB'

export const MODALS = {
  LOGIN_MODAL: 'LOGIN_MODAL',
  PROFILE_MODAL: 'PROFILE_MODAL'
}

export const THEMES = {
  LIGHT: 'LIGHT',
  DARK: 'DARK'
}

export function sendMessage (text) {
  return { type: SEND_MESSAGE, text }
}

export function receiveMessage (message) {
  const { key, from, text, result } = message
  return { type: RECEIVE_MESSAGE, key, from, text, result }
}

export function updateUser (user) {
  return { type: UPDATE_USER, user }
}

export function login (email, password) {
  return { type: LOGIN, email, password } 
}

export function logout () {
  return { type: LOGOUT }
}

export function showModal (modal) {
  return { type: SHOW_MODAL, modal }
}

export function hideModal () {
  return { type: HIDE_MODAL }
}

export function toggleChatPin () {
  return { type: TOGGLE_CHAT_PIN }
}

export function changeTheme (theme) {
  return { type: CHANGE_THEME }
}

export function receivePreferences (prefs) {
  return { type: RECEIVE_PREFS, prefs }
}

export const changeSidebarTab = tab => ({ type: CHANGE_SIDEBAR_TAB, tab })

@@ -1,518 +1,4 @@
-// messages%0Aexport const SEND_MESSAGE = 'SEND_MESSAGE'%0Aexport const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE'%0A// user%0Aexport const UPDATE_USER = 'UPDATE_USER'%0Aexport const LOGIN = 'LOGIN'%0Aexport const LOGOUT = 'LOGOUT'%0A// modals%0Aexport const SHOW_MODAL = 'SHOW_MODAL'%0Aexport const HIDE_MODAL = 'SHOW_MODAL'%0A// prefs%0Aexport const TOGGLE_CHAT_PIN = 'TOGGLE_CHAT_PIN'%0Aexport const CHANGE_THEME = 'CHANGE_THEME'%0Aexport const RECEIVE_PREFS = 'RECEIVE_PREFS'%0A// sidebar%0Aexport const CHANGE_SIDEBAR_TAB = 'CHANGE_SIDEBAR_TAB'%0A%0A
 expo
@@ -143,31 +143,87 @@
 ARK'%0A%7D%0A%0A
-export function
+/* Messages */%0A%0Aexport const SEND_MESSAGE = 'SEND_MESSAGE'%0Aexport const
  sendMes
@@ -231,28 +231,20 @@
 age 
-(
+= 
 text
-) %7B%0A  return %7B 
+ =%3E (%7B
 type
@@ -265,18 +265,17 @@
 , text %7D
-%0A%7D
+)
 %0A%0Aexport
@@ -271,32 +271,78 @@
  %7D)%0A%0Aexport 
-function
+const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE'%0Aexport const
  receiveMess
@@ -349,17 +349,20 @@
 age 
-(
+= 
 message
-)
+ =%3E
  %7B%0A 
@@ -469,31 +469,80 @@
 lt %7D%0A%7D%0A%0A
-export function
+/* User */%0Aexport const UPDATE_USER = 'UPDATE_USER'%0Aexport const
  updateU
@@ -549,26 +549,19 @@
 ser 
-(
+= 
 user
-) %7B%0A  return 
+ =%3E (
 %7B ty
@@ -583,18 +583,17 @@
 , user %7D
-%0A%7D
+)
 %0A%0Aexport
@@ -597,22 +597,50 @@
 ort 
-function
+const LOGIN = 'LOGIN'%0Aexport const
  login
+ =
  (em
@@ -654,27 +654,20 @@
 ssword) 
-%7B%0A  return 
+=%3E (
 %7B type: 
@@ -694,50 +694,71 @@
 rd %7D
- %0A%7D%0A%0Aexport function
+)%0A%0Aexport const LOGOUT = 'LOGOUT'%0Aexport const
  logout
+ =
  () 
-%7B%0A  return 
+=%3E (
 %7B ty
@@ -769,35 +769,83 @@
 LOGOUT %7D
-%0A%7D%0A%0Aexport function
+)%0A%0A/* Modals */%0Aexport const SHOW_MODAL = 'SHOW_MODAL'%0Aexport const
  showMod
@@ -851,27 +851,20 @@
 dal 
-(
+= 
 modal
-) %7B%0A  return 
+ =%3E (
 %7B ty
@@ -886,35 +886,70 @@
  modal %7D
-%0A%7D%0A%0Aexport function
+)%0A%0Aexport const HIDE_MODAL = 'SHOW_MODAL'%0Aexport const
  hideMod
@@ -950,31 +950,26 @@
 ideModal
+ =
  () 
-%7B%0A  return 
+=%3E (
 %7B type: 
@@ -980,35 +980,98 @@
 _MODAL %7D
-%0A%7D%0A%0Aexport function
+)%0A%0A/* Preferences */%0Aexport const TOGGLE_CHAT_PIN = 'TOGGLE_CHAT_PIN'%0Aexport const
  toggleC
@@ -1080,23 +1080,18 @@
 tPin
+ =
  () 
-%7B%0A  return 
+=%3E (
 %7B ty
@@ -1111,35 +1111,74 @@
 AT_PIN %7D
-%0A%7D%0A%0Aexport function
+)%0A%0Aexport const CHANGE_THEME = 'CHANGE_THEME'%0Aexport const
  changeT
@@ -1186,27 +1186,20 @@
 eme 
-(
+= 
 theme
-) %7B%0A  return 
+ =%3E (
 %7B ty
@@ -1216,18 +1216,17 @@
 _THEME %7D
-%0A%7D
+)
 %0A%0Aexport
@@ -1230,16 +1230,58 @@
 ort 
-function
+const RECEIVE_PREFS = 'RECEIVE_PREFS'%0Aexport const
  rec
@@ -1300,27 +1300,20 @@
 ces 
-(
+= 
 prefs
-) %7B%0A  return 
+ =%3E (
 %7B ty
@@ -1338,19 +1338,87 @@
  prefs %7D
-%0A%7D%0A
+)%0A%0A/* Sidebar */%0Aexport const CHANGE_SIDEBAR_TAB = 'CHANGE_SIDEBAR_TAB'
 %0Aexport 

Reorganize actions and action creators.