Browse Source

fixed app reducer

Skylsmoi 6 years ago
parent
commit
88228f9c51

File diff suppressed because it is too large
+ 3 - 3
dist/app/pageHtml.app.js


+ 0 - 1
dist/index.html View File

@@ -44,7 +44,6 @@
44 44
       }
45 45
 
46 46
       GLOBAL_unmountApp = () => {
47
-        console.log('btn close clicked')
48 47
         appPageHtml.hideApp('appContainer')
49 48
       }
50 49
 

+ 3 - 1
package.json View File

@@ -52,7 +52,9 @@
52 52
   "standard": {
53 53
     "globals": [
54 54
       "fetch",
55
-      "history"
55
+      "history",
56
+      "GLOBAL_renderApp",
57
+      "GLOBAL_unmountApp"
56 58
     ],
57 59
     "parser": "babel-eslint",
58 60
     "ignore": []

+ 1 - 1
src/app/ContentType/PageHtml/index.js View File

@@ -1,4 +1,4 @@
1
-import reducer from './pageHtml.js'
1
+import reducer from '../../../reducer/app/pageHtml.js'
2 2
 // import container from './PageHtmlContainer.jsx'
3 3
 // import component from './PageHtmlComponent.jsx'
4 4
 

+ 0 - 15
src/app/ContentType/PageHtml/pageHtml.js View File

@@ -1,15 +0,0 @@
1
-import { APP_LIST } from '../../../action-creator.sync.js'
2
-
3
-export default function pageHtml (state = {
4
-  title: '',
5
-  version: 0,
6
-  icon: ''
7
-}, action) {
8
-  switch (action.type) {
9
-    case `Set/${APP_LIST}`:
10
-      return action.appList.find(p => p.name === 'PageHtml')
11
-
12
-    default:
13
-      return state
14
-  }
15
-}

+ 1 - 1
src/app/ContentType/Thread/index.js View File

@@ -1,4 +1,4 @@
1
-import reducer from './thread.js'
1
+import reducer from '../../../reducer/app/thread.js'
2 2
 // import container from './ThreadContainer.jsx'
3 3
 // import component from './ThreadComponent.jsx'
4 4
 

+ 0 - 15
src/app/ContentType/Thread/thread.js View File

@@ -1,15 +0,0 @@
1
-import { APP_LIST } from '../../../action-creator.sync.js'
2
-
3
-export default function thread (state = {
4
-  title: '',
5
-  version: 0,
6
-  icon: ''
7
-}, action) {
8
-  switch (action.type) {
9
-    case `Set/${APP_LIST}`:
10
-      return action.appList.find(p => p.name === 'Thread')
11
-
12
-    default:
13
-      return state
14
-  }
15
-}

+ 1 - 0
src/component/common/Input/BtnSwitch.jsx View File

@@ -1,5 +1,6 @@
1 1
 import React, { Component } from 'react'
2 2
 
3
+// Côme - 2018/03/01 - DEPRECATED - this component has been added to tracim_lib
3 4
 class BtnSwitch extends Component {
4 5
   render () {
5 6
     return (

+ 17 - 7
src/reducer/app.js View File

@@ -1,9 +1,19 @@
1
-import { combineReducers } from 'redux'
2
-import appDatabase from '../app/index.js'
1
+import { APP_LIST } from '../action-creator.sync.js'
3 2
 
4
-const reducerList = {}
5
-appDatabase.forEach(p => (reducerList[p.name] = p.reducer))
3
+export default function app (state = {
4
+  name: '',
5
+  componentLeft: '',
6
+  componentRight: '',
7
+  customClass: '',
8
+  icon: ''
9
+}, action) {
10
+  switch (action.type) {
11
+    case `Set/${APP_LIST}`:
12
+      const rez = {}
13
+      action.appList.forEach(app => (rez[app.name] = app))
14
+      return rez
6 15
 
7
-export default combineReducers({
8
-  ...reducerList
9
-})
16
+    default:
17
+      return state
18
+  }
19
+}