-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
284 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.export = { | ||
module.exports = { | ||
users: [ | ||
{ | ||
id: 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
export default { | ||
INIT: 'INIT', | ||
|
||
USER_SELECTED: 'USER_SELECTED', | ||
USERS_FETCH_ING: 'USERS_FETCH_ING', | ||
USERS_FETCH_SUCCESS: 'USERS_FETCH_SUCCESS', | ||
USERS_FETCH_FAIL: 'USERS_FETCH_FAIL', | ||
|
||
CANCEL_INFO_FETCH: 'CANCEL_INFO_FETCH', | ||
|
||
USER_INFO_ING: 'USER_INFO_ING', | ||
USER_INFO_SUCCESS: 'USER_INFO_SUCCESS', | ||
USER_INFO_FAIL: 'USER_INFO_FAIL', | ||
|
||
RCV_MSG: 'RCV_MSG', | ||
SND_MSG: 'SND_MSG', | ||
WS_OPEN_PENDING: 'WS_OPEN_PENDING', | ||
WS_OPEN_SUCCESS: 'WS_OPEN_SUCCESS', | ||
WS_OPEN_FAIL: 'WS_OPEN_FAIL', | ||
WS_CLOSING: 'WS_CLOSING', | ||
WS_CLOSED: 'WS_CLOSED', | ||
WS_MSG_RECEIVED: 'WS_MSG_RECEIVED', | ||
WS_MSG_SEND: 'WS_MSG_SEND', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { combineReducers } from 'redux'; | ||
|
||
import users from './users'; | ||
import userData from './userData'; | ||
|
||
export default combineReducers({ | ||
userData, | ||
users, | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import actions from '../actions'; | ||
|
||
const initState = { | ||
data: {}, | ||
loading: false, | ||
error: null, | ||
} | ||
|
||
export default function(state = initState, action) { | ||
switch (action.type) { | ||
case actions.USER_INFO_ING: | ||
return { | ||
...initState, | ||
loading: true, | ||
} | ||
case actions.USER_INFO_SUCCESS: | ||
return { | ||
...state, | ||
loading: false, | ||
data: action.payload, | ||
} | ||
case actions.USER_INFO_FAIL: | ||
return { | ||
...state, | ||
loading: false, | ||
error: action.error, | ||
} | ||
default: | ||
return state; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import actions from './actions'; | ||
import { | ||
Table, | ||
} from './components.jsx'; | ||
TableConnected, | ||
UserDataConnected, | ||
} from './containers'; | ||
|
||
export default function() { return (<div>app</div>); }; | ||
class Root extends React.Component { | ||
componentDidMount() { | ||
this.props.getUsers(); | ||
// this.props.init(); | ||
} | ||
render() { | ||
return ( | ||
<div> | ||
<TableConnected /> | ||
<UserDataConnected /> | ||
{/*<button onClick={this.props.cancelRequest}>CANCEL</button>*/} | ||
</div>); | ||
} | ||
}; | ||
|
||
export default connect(null, | ||
(dispatch) => ({ | ||
getUsers: () => dispatch({ type: actions.USERS_FETCH_ING }), | ||
// init: () => dispatch({ type: actions.INIT }), | ||
// cancelRequest: () => dispatch({ type: actions.CANCEL_INFO_FETCH }), | ||
}) | ||
)(Root); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
.users { | ||
margin: auto; | ||
display: flex; | ||
font-family: OpenSans, sans-serif; | ||
font-size: 40px; | ||
font-weight: 400; | ||
} | ||
|
||
.user { | ||
padding: 10px; | ||
padding: 10px 20px; | ||
cursor: pointer; | ||
.selected { | ||
background-color: #AAA; | ||
&.selected { | ||
background-color: #AAC366; | ||
} | ||
} | ||
.userdata { | ||
font-size: 40px; | ||
font-family: OpenSans, sans-serif; | ||
&.loading { | ||
background-color: #ccc; | ||
} | ||
border: 1px solid #AAC366; | ||
.name { | ||
padding: 10px 5px; | ||
} | ||
.age { | ||
padding: 5px; | ||
} | ||
} | ||
button { | ||
font-size: 40px; | ||
padding: 10px; | ||
margin: 30px auto; | ||
} |
Oops, something went wrong.