text: import store from 'store'
  import actions from './actions'
  
  const STORED_SETTINGS = storedSettings => {
    const settings = {}
    Object.keys(storedSettings).forEach(key => {
      const item = store.get(`app.settings.${key}`)
      settings[key] = typeof item !== 'undefined' ? item : storedSettings[key]
    })
    return settings
  }
  
  const initialState = {
    ...STORED_SETTINGS({
      authProvider: 'firebase', // firebase, jwt
      logo: 'LearnLab',
      locale: 'en-US',
      isSidebarOpen: false,
      isSupportChatOpen: false,
      isMobileView: false,
      isMobileMenuOpen: false,
      isMenuCollapsed: true,
      menuLayoutType: 'left', // left, top, nomenu
      routerAnimation: 'slide-fadein-up', // none, slide-fadein-up, slide-fadein-right, fadein, zoom-fadein
      menuColor: 'white', // white, dark, gray
      theme: 'default', // default, dark
      authPagesColor: 'white', // white, gray, image
      primaryColor: '#0052CC',
      leftMenuWidth: 256,
      isMenuUnfixed: false,
      isMenuShadow: true,
      isTopbarFixed: true,
      isGrayTopbar: false,
      isContentMaxWidth: false,
      isAppMaxWidth: false,
      isGrayBackground: true,
      isCardShadow: true,
      isSquaredBorders: false,
      isBorderless: true,
    }),
  }
  
  export default function settingsReducer(state = initialState, action) {
    switch (action.type) {
      case actions.SET_STATE:
        return { ...state, ...action.payload }
      default:
        return state
    }
  }
  