2018-07-02 16:05:58 +02:00
|
|
|
// @flow
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
2018-07-04 09:55:02 +02:00
|
|
|
import { fetchUsersIfNeeded } from '../modules/users';
|
2018-07-04 16:43:46 +02:00
|
|
|
import Login from '../../containers/Login';
|
2018-07-02 16:05:58 +02:00
|
|
|
|
|
|
|
|
type Props = {
|
2018-07-02 16:22:24 +02:00
|
|
|
login: boolean,
|
2018-07-02 16:05:58 +02:00
|
|
|
error: any,
|
2018-07-04 09:55:02 +02:00
|
|
|
users: any,
|
|
|
|
|
fetchUsersIfNeeded: () => void
|
2018-07-02 16:05:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Users extends React.Component<Props> {
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
2018-07-04 09:55:02 +02:00
|
|
|
this.props.fetchUsersIfNeeded();
|
2018-07-02 16:05:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
2018-07-04 09:55:02 +02:00
|
|
|
const { login, error, users } = this.props;
|
2018-07-02 16:05:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<h1>SCM</h1>
|
|
|
|
|
<h2>Users</h2>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2018-07-04 16:43:46 +02:00
|
|
|
|
2018-07-02 16:05:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
|
return null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
|
return {
|
2018-07-04 09:55:02 +02:00
|
|
|
fetchUsersIfNeeded: () => {
|
|
|
|
|
dispatch(fetchUsersIfNeeded())
|
2018-07-02 16:05:58 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Users);
|