import React from 'react'; import PropTypes from 'prop-types'; import UserPicture from '../User/UserPicture'; export default class UserList extends React.Component { isSeenUserListShown() { const userCount = this.props.users.length; if (0 < userCount && userCount <= 10) { return true; } return false; } render() { if (!this.isSeenUserListShown()) { return null; } const users = this.props.users.map((user) => { return ( ); }); return (

{users}

); } } UserList.propTypes = { users: PropTypes.array, }; UserList.defaultProps = { users: [], };