Last active
August 11, 2021 11:55
-
-
Save hieptl/05cd7c2a7dff4ff4694649d51837e559 to your computer and use it in GitHub Desktop.
Header Icon Component - Facebook Clone
This file contains hidden or 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
function HeaderIcon({active, icon, onClick }) { | |
const handleClick = () => { | |
if (onClick) { | |
onClick(); | |
} | |
} | |
return ( | |
<div className={`${active ? 'icon--active' : ''} header__icon`} onClick={handleClick}> | |
{icon} | |
</div> | |
); | |
} | |
export default HeaderIcon; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment