Skip to content

Instantly share code, notes, and snippets.

@raullucero
Created November 15, 2017 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raullucero/35ced9cd957217ece185d2f35ae7603d to your computer and use it in GitHub Desktop.
Save raullucero/35ced9cd957217ece185d2f35ae7603d to your computer and use it in GitHub Desktop.
import styles from './PanelDropdown.css';
import React from 'react';
import classnames from 'classnames';
import Dropdown from 'views/shared/Components/DropDown/DropDown';
import { getIconByType } from 'views/shared/Components/SingleEvent/SingleEvent';
const PanelDropdown = (props) =>
<div>
<Dropdown
{...props}
searchable
optionRenderer={renderOption}
className={styles.dropdown}
clearable={false}
/>
</div>;
const renderOption = (option) => {
const icon = option.iconType ? getIconByType(option.iconType) : null;
return (
<div className={classnames(styles.option, {[styles.header]: option.disable})}>
<span>{option.label}</span>
{
icon &&
<span>{icon}</span>
}
{
option.description &&
<span>{option.description}</span>
}
</div>
);
};
export default PanelDropdown;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment