Bläddra i källkod

removed unused code + general fix

Skylsmoi 7 år sedan
förälder
incheckning
c16da745a6
6 ändrade filer med 17 tillägg och 31 borttagningar
  1. 13 1
      README.md
  2. 3 1
      package.json
  3. 1 1
      src/container/PageHtml.jsx
  4. 0 1
      src/index.js
  5. 0 6
      src/reducer/root.js
  6. 0 21
      src/reducer/user.js

+ 13 - 1
README.md Visa fil

1
-# react init
1
+# App PageHtml for Tracim
2
+
3
+This repo is an app loaded by Tracim.
4
+
5
+### To update this repo
6
+- commit and push changes
7
+- run `$ npm run build`
8
+- copy dist/pageHtml.app.js and past it into Tracim(repo)/dist/app
9
+
10
+### Development
11
+To see your changes without importing the app into Tracim:
12
+- run `$ npm run servdev`
13
+Which will create a web server (webpack) where you will see the app loaded with some default values

+ 3 - 1
package.json Visa fil

45
   "standard": {
45
   "standard": {
46
     "globals": [
46
     "globals": [
47
       "fetch",
47
       "fetch",
48
-      "history"
48
+      "history",
49
+      "GLOBAL_renderApp",
50
+      "GLOBAL_unmountApp"
49
     ],
51
     ],
50
     "parser": "babel-eslint",
52
     "parser": "babel-eslint",
51
     "ignore": []
53
     "ignore": []

+ 1 - 1
src/container/PageHtml.jsx Visa fil

35
 
35
 
36
   customEventReducer = ({detail}) => {
36
   customEventReducer = ({detail}) => {
37
     switch (detail.type) {
37
     switch (detail.type) {
38
-      case 'PageHtml_showMsg':
38
+      case 'PageHtml_showMsg': // unused for now, for testing purpose
39
         this.setState({inputText: detail.content})
39
         this.setState({inputText: detail.content})
40
         break
40
         break
41
     }
41
     }

+ 0 - 1
src/index.js Visa fil

12
     )
12
     )
13
   },
13
   },
14
   hideApp: domId => {
14
   hideApp: domId => {
15
-    // TODO: should be a display none
16
     return ReactDOM.unmountComponentAtNode(document.getElementById(domId)) // returns bool
15
     return ReactDOM.unmountComponentAtNode(document.getElementById(domId)) // returns bool
17
   }
16
   }
18
 }
17
 }

+ 0 - 6
src/reducer/root.js Visa fil

1
-import { combineReducers } from 'redux'
2
-import user from './user.js'
3
-
4
-const rootReducer = combineReducers({ user })
5
-
6
-export default rootReducer

+ 0 - 21
src/reducer/user.js Visa fil

1
-import {
2
-  USER_CONNECTED,
3
-  USER_DATA
4
-} from '../action-creator.sync.js'
5
-
6
-export default function user (state = {
7
-  isLoggedIn: false,
8
-  username: '',
9
-  email: ''
10
-}, action) {
11
-  switch (action.type) {
12
-    case `Update/${USER_CONNECTED}`:
13
-      return {...state, isLoggedIn: true, ...action.user}
14
-
15
-    case `Update/${USER_DATA}`:
16
-      return {...state, ...action.data}
17
-
18
-    default:
19
-      return state
20
-  }
21
-}