Skip to content

Instantly share code, notes, and snippets.

@keevie
Last active May 18, 2017 13:06
Show Gist options
  • Save keevie/1b99b15acfc7e21c978dd7902a037b70 to your computer and use it in GitHub Desktop.
Save keevie/1b99b15acfc7e21c978dd7902a037b70 to your computer and use it in GitHub Desktop.
return responseData.map(suggestion => {
return {
title: suggestion.title,
value: (
<MenuItem
description={suggestion.description}
library_name={suggestion.library_name}
external_identifier={suggestion.external_identifier}
style={{ border: 0, lineHeight: 1 }}
>
<div className='auto-complete-menu-item'>
<div className='auto-complete-title'>
{suggestion.title}
</div>
<div className='auto-complete-library'>
<LibraryIcon style={{ width: '20px', height: '11px' }} />
<span>{suggestion.library_name}</span>
</div>
<div className='auto-complete-description'>
{suggestion.description}
</div>
</div>
</MenuItem>
),
};
});
.............................................................
handleSelect(searchText) {
const description = searchText.value.props.description;
const library_name = searchText.value.props.library_name;
const external_identifier = searchText.value.props.external_identifier;
this.setState({ searchText: searchText.title, description, library_name, external_identifier });
this.submit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment