Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import classNames from 'classnames';
  2.  
  3. class UserPanel {
  4.  
  5. constructor(props) {
  6. super(props);
  7. this.state = {
  8. dropdownActive : false
  9. };
  10. }
  11.  
  12. toggleDropdown() {
  13. this.setState({
  14. dropdownActive : !this.state.dropdownActive
  15. });
  16. }
  17.  
  18. render() {
  19.  
  20. const dropdownClasses = classNames('dropdown default classes', {
  21. active : this.state.dropdownActive
  22. });
  23.  
  24. return (
  25. <a href="#" onClick={toggleDropdown}>Show Dropdown</a>
  26.  
  27. <div className={dropdownClasses}>
  28. //Dropdown
  29. </div>
  30. );
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement