import KolibriApp from 'kolibri_app';
import RootVue from './views';
import * as actions from './state/actions/main';
import {
  showLearn,
  showPopularPage,
  showNextStepsPage,
  showResumePage,
  showFeaturedPage,
  showLearnContent,
} from './state/actions/recommended';
import { initialState, mutations } from './state/store';
import { PageNames } from './constants';
import classesRoutes from './classesRoutes';
import store from 'kolibri.coreVue.vuex.store';

const routes = [
  {
    path: '/',
    redirect: '/recommended',
  },
  {
    name: PageNames.TOPICS_ROOT,
    path: '/topics',
    handler: () => {
      actions.showChannels(store);
    },
  },
  {
    name: PageNames.RECOMMENDED,
    path: '/recommended',
    handler: () => {
      showLearn(store);
    },
  },
  {
    name: PageNames.SEARCH,
    path: '/search',
    handler: toRoute => {
      actions.showSearch(store, toRoute.query.query);
    },
  },
  {
    name: PageNames.CONTENT_UNAVAILABLE,
    path: '/content-unavailable',
    handler: () => {
      actions.showContentUnavailable(store);
    },
  },
  {
    name: PageNames.TOPICS_CHANNEL,
    path: '/topics/:channel_id',
    handler: toRoute => {
      actions.showTopicsChannel(store, toRoute.params.channel_id);
    },
  },
  {
    name: PageNames.TOPICS_TOPIC,
    path: '/topics/t/:id',
    handler: toRoute => {
      actions.showTopicsTopic(store, toRoute.params.id);
    },
  },
  {
    name: PageNames.TOPICS_CONTENT,
    path: '/topics/c/:id',
    handler: toRoute => {
      actions.showTopicsContent(store, toRoute.params.id);
    },
  },
  {
    name: PageNames.RECOMMENDED_POPULAR,
    path: '/recommended/popular',
    handler: () => {
      showPopularPage(store);
    },
  },
  {
    name: PageNames.RECOMMENDED_RESUME,
    path: '/recommended/resume',
    handler: () => {
      showResumePage(store);
    },
  },
  {
    name: PageNames.RECOMMENDED_NEXT_STEPS,
    path: '/recommended/nextsteps',
    handler: () => {
      showNextStepsPage(store);
    },
  },
  {
    name: PageNames.RECOMMENDED_FEATURED,
    path: '/recommended/featured/:channel_id',
    handler: toRoute => {
      showFeaturedPage(store, toRoute.params.channel_id);
    },
  },
  {
    name: PageNames.RECOMMENDED_CONTENT,
    path: '/recommended/:id',
    handler: toRoute => {
      showLearnContent(store, toRoute.params.id);
    },
  },
  ...classesRoutes,
  {
    path: '*',
    redirect: '/',
  },
];

class LearnModule extends KolibriApp {
  get stateSetters() {
    return [actions.prepareLearnApp];
  }
  get routes() {
    return routes;
  }
  get RootVue() {
    return RootVue;
  }
  get initialState() {
    return initialState;
  }
  get mutations() {
    return mutations;
  }
}

const learnModule = new LearnModule();

export { learnModule as default };

@@ -73,20 +73,147 @@
 ort 
-* as actions
+%7B%0A  prepareLearnApp,%0A  showChannels,%0A  showSearch,%0A  showContentUnavailable,%0A  showTopicsTopic,%0A  showTopicsChannel,%0A  showTopicsContent,%0A%7D
  fro
@@ -740,32 +740,24 @@
  =%3E %7B%0A      
-actions.
 showChannels
@@ -978,32 +978,24 @@
  =%3E %7B%0A      
-actions.
 showSearch(s
@@ -1136,32 +1136,24 @@
  =%3E %7B%0A      
-actions.
 showContentU
@@ -1284,32 +1284,24 @@
  =%3E %7B%0A      
-actions.
 showTopicsCh
@@ -1446,32 +1446,24 @@
  =%3E %7B%0A      
-actions.
 showTopicsTo
@@ -1604,24 +1604,16 @@
 %7B%0A      
-actions.
 showTopi
@@ -2588,16 +2588,8 @@
 rn %5B
-actions.
 prep
@@ -2793,27 +2793,22 @@
 %0A%7D%0A%0A
-const learnModule =
+export default
  new
@@ -2827,40 +2827,4 @@
 ();%0A
-%0Aexport %7B learnModule as default %7D;%0A

Use named imports in learn/app.js