mock平台

User.js 1017B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import './index.scss';
  2. import React, { PureComponent as Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import { Route } from 'react-router-dom';
  5. import List from './List.js';
  6. import PropTypes from 'prop-types';
  7. import Profile from './Profile.js';
  8. import { Row } from 'antd';
  9. @connect(
  10. state => {
  11. return {
  12. curUid: state.user.uid,
  13. userType: state.user.type,
  14. role: state.user.role
  15. };
  16. },
  17. {}
  18. )
  19. class User extends Component {
  20. static propTypes = {
  21. match: PropTypes.object,
  22. curUid: PropTypes.number,
  23. userType: PropTypes.string,
  24. role: PropTypes.string
  25. };
  26. constructor(props) {
  27. super(props);
  28. }
  29. render() {
  30. return (
  31. <div>
  32. <div className="g-doc">
  33. <Row className="user-box">
  34. <Route path={this.props.match.path + '/list'} component={List} />
  35. <Route path={this.props.match.path + '/profile/:uid'} component={Profile} />
  36. </Row>
  37. </div>
  38. </div>
  39. );
  40. }
  41. }
  42. export default User;