Prechádzať zdrojové kódy

removed the stats component.

Tomi Cvetic 7 rokov pred
rodič
commit
0fc1094fa2
3 zmenil súbory, kde vykonal 11 pridanie a 32 odobranie
  1. 6 6
      src/index.js
  2. 5 4
      src/player/state.js
  3. 0 22
      src/stats/stats.js

+ 6 - 6
src/index.js

@@ -24,14 +24,14 @@ import match from './match'
 /** The root reducer is combined from all sub-module reducers */
 const rootReducer = combineReducers({
   player: player.reducer,
-  match: match.reducer,
+  match: match.reducer
 })
 console.log('Root reducer:', rootReducer)
 
 /** The default state is combined from all sub-module states */
 const defaultState = {
   player: player.state,
-  match: match.state,
+  match: match.state
 }
 console.log('Default state:', defaultState)
 
@@ -50,9 +50,9 @@ console.log('history:', history)
 */
 
 /** Collect the action creators from all modules in actionCreators */
-const actionCreators = { 
+const actionCreators = {
   player: player.actions,
-  match: match.actions,
+  match: match.actions
 }
 
 /** Creates a function  */
@@ -77,7 +77,6 @@ function mapDispatchToProps (dispatch) {
 
 const App = connect(mapStateToProps, mapDispatchToProps)(Main)
 
-
 /**
  * React-Router Section
  **/
@@ -102,6 +101,7 @@ const router = (
   </Provider>
 )
 */
+
 const provider = (
   <Provider store={store}>
     <App />
@@ -114,4 +114,4 @@ const provider = (
 ReactDOM.render(
   provider,
   document.getElementById('root')
-)
+)

+ 5 - 4
src/player/state.js

@@ -6,12 +6,13 @@
  * Collection of everything which has to do with state changes.
  **/
 
-
 /** actionTypes define what actions are handeled by the reducer. */
 export const actions = {
   setState: players => {
-    type: 'SET_PLAYERS',
-    players
+    return {
+      type: 'SET_PLAYERS',
+      players
+    }
   }
 }
 console.log('State actions', actions)
@@ -27,4 +28,4 @@ export function reducer (state = [], action) {
 }
 
 /** sagas are asynchronous workers (JS generators) to handle the state. */
-export function * saga () {}
+export function * saga () {}

+ 0 - 22
src/stats/stats.js

@@ -1,22 +0,0 @@
-import React from 'react'
-
-class Stats extends React.Component {
-  render () {
-    const data = this.props.stats
-
-    return (
-        <div id='stats'>
-        <h2>Statistik</h2>
-        <table>
-            <tbody>
-                {Object.keys(data).map((key, idx) => (
-                    <tr key={idx}><th>{key}</th><td>{data[key].length}</td></tr>
-                ))}
-            </tbody>
-        </table>
-        </div>
-    )
-  }
-}
-
-export default Stats