Created
February 7, 2023 11:56
-
-
Save wpflames/2ac4eb7d093cc0063df2fd74ce99ac46 to your computer and use it in GitHub Desktop.
Stateless functional components
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
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
const UserItem = ({ user: { login, avatar_url, html_url } }) => { | |
return ( | |
<div className='card text-center'> | |
<img | |
className='round-img' | |
src={avatar_url} | |
alt={login} | |
style={{ width: '60px' }} | |
/> | |
<h3 className='card-title text-center'>{login}</h3> | |
<a className='btn btn-dark btn-sm my-1' href={html_url}> | |
More | |
</a> | |
</div> | |
); | |
}; | |
UserItem.propTypes = { | |
user: PropTypes.object.isRequired, | |
}; | |
export default UserItem; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment