import {React} from 'nylas-exports'; export default class Dropdown extends React.Component { constructor(props) { super(props); this.state = { closed: true, selected: props.defaultOption, onSelect: props.onSelect, } } open() { this.setState({closed: false}); } selectAndClose(selection) { this.setState({ closed: true, selected: selection, }) this.state.onSelect(selection); } close() { this.setState({closed: true}); } render() { // Currently selected option (includes dropdown arrow) const selectedOnClick = this.state.closed ? this.open : this.close; const selected = (