Created
October 29, 2020 12:12
-
-
Save vansika/4fefce86c1465c0b71ce1e4ce91aa77d to your computer and use it in GitHub Desktop.
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
<RecommendationControl | |
iconHover={faAngry} | |
iconNonHover={faAngryRegular} | |
title="I never want to hear this again!" | |
action={() => | |
feedback === "hate" | |
? this.deleteFeedback("Like", faThumbsUpRegular) | |
: this.submitFeedback("hate", faAngry, "hate") | |
} | |
classNameHover="on" | |
classNameNonHover="off" | |
/> | |
const RecommendationControl = (props: RecommendationControlProps) => { | |
const { classNameHover, iconHover, classNameNonHover, iconNonHover, action, title } = props; | |
return ( | |
<div className='recommendation-icon' title={title} | |
onClick={action}><span> | |
<FontAwesomeIcon | |
icon={iconHover as IconProp} | |
className={classNameHover} | |
/></span> | |
<span> | |
<FontAwesomeIcon | |
icon={iconNonHover as IconProp} | |
className={classNameNonHover} | |
/></span> | |
</div> | |
); | |
}; | |
.recommendation-icon:hover .off, | |
.recommendation-icon .on { | |
display: none; | |
} | |
.recommendation-icon:hover .on { | |
display: inline; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment