ソースを参照

removed unused code + general fix

Skylsmoi 6 年 前
コミット
c16da745a6
共有6 個のファイルを変更した17 個の追加31 個の削除を含む
  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 ファイルの表示

@@ -1 +1,13 @@
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 ファイルの表示

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

+ 1 - 1
src/container/PageHtml.jsx ファイルの表示

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

+ 0 - 1
src/index.js ファイルの表示

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

+ 0 - 6
src/reducer/root.js ファイルの表示

@@ -1,6 +0,0 @@
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 ファイルの表示

@@ -1,21 +0,0 @@
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
-}