Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pkellner/54c002d3e76ec94ea63ac0cb2d660d43 to your computer and use it in GitHub Desktop.
Save pkellner/54c002d3e76ec94ea63ac0cb2d660d43 to your computer and use it in GitHub Desktop.
...
render() {
return (
<div
className={`${this.props.className
? this.props.className
: ''} session-status-dropdown`}
ref={dropdownContainer => {
this.dropdownContainer = dropdownContainer;
}}
>
<div className="dropdown">
<div
className="btn btn-white btn-white--bordered dropdown-container"
id={`dropdownEventsJumboList${this.props.id}`}
>
<button
className={`dropdown__switcher ${this.props.status ===
STATUS_INTERESTED
? 'dropdown__switcher--interested'
: ''} ${this.props.status === STATUS_ATTENDING
? 'dropdown__switcher--registered'
: ''}`}
onClick={this.swapStatus}
>
{this.props.status === STATUS_ATTENDING && (
<i
className="fa fa-check events-sessions-list__status-icon"
aria-hidden="true"
/>
)}
{this.props.status === STATUS_INTERESTED && (
<i
className="fa fa-star-o events-sessions-list__status-icon"
aria-hidden="true"
/>
)}
{this.getCurrentStatusText()}
</button>
<button
className="dropdown__toggle-dropdown"
aria-haspopup="true"
aria-expanded={this.state.isStatusListVisible ? 'true' : 'false'}
onClick={this.toggleDropdown}
>
<span className="sr-only">Toggle Dropdown</span>
</button>
</div>
<div
className={`dropdown-menu ${this.state.isStatusListVisible
? 'show'
: ''}`}
aria-labelledby={`dropdownEventsJumboList${this.props.id}`}
>
<a
className="dropdown-item"
href=""
onClick={event =>
this.setCurrentStatusOnClick(event, STATUS_DEFAULT)}
>
Not Interested
</a>
<a
className="dropdown-item"
href=""
onClick={event =>
this.setCurrentStatusOnClick(event, STATUS_INTERESTED)}
>
Interested
</a>
<a
className="dropdown-item"
href=""
onClick={event =>
this.setCurrentStatusOnClick(event, STATUS_ATTENDING)}
>
Register
</a>
</div>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment