Created
November 15, 2017 23:59
-
-
Save raullucero/35ced9cd957217ece185d2f35ae7603d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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