Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. export default () => {
  2. const theme = useContext(Theme);
  3.  
  4. const [isHoveringSendButton, setIsHoveringSendButton] = useState(false);
  5. const [themeButtonStyle, setThemeButtonStyle] = useState({});
  6.  
  7. useEffect(() => {
  8. setThemeButtonStyle({
  9. backgroundColor: isHoveringSendButton ? `lighten(${theme.primaryColor}, 50%)` : theme.primaryColor
  10. });
  11. }, [isHoveringSendButton, theme.primaryColor]);
  12.  
  13. return (
  14. <div>
  15. <input type="text" />
  16. <button style={themeButtonStyle}
  17. onMouseEnter={() => setIsHoveringSendButton(true)} onMouseLeave={() => setIsHoveringSendButton(false)}>
  18. Enviar
  19. </button>
  20. </div>
  21. );
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement