WIP <Compose> Refactor; 1000 tiny edits
This commit is contained in:
@ -18,9 +18,9 @@ export default function ComposerTextareaSuggestions ({
|
||||
return (
|
||||
<div
|
||||
className='composer--textarea--suggestions'
|
||||
hidden={hidden || suggestions.isEmpty()}
|
||||
hidden={hidden || !suggestions || suggestions.isEmpty()}
|
||||
>
|
||||
{!hidden ? suggestions.map(
|
||||
{!hidden && suggestions ? suggestions.map(
|
||||
(suggestion, index) => (
|
||||
<ComposerTextareaSuggestionsItem
|
||||
index={index}
|
||||
@ -39,5 +39,5 @@ ComposerTextareaSuggestions.propTypes = {
|
||||
hidden: PropTypes.bool,
|
||||
onSuggestionClick: PropTypes.func,
|
||||
suggestions: ImmutablePropTypes.list,
|
||||
value: PropTypes.string,
|
||||
value: PropTypes.number,
|
||||
};
|
||||
|
@ -17,7 +17,7 @@ const assetHost = ((process || {}).env || {}).CDN_HOST || '';
|
||||
const handlers = {
|
||||
|
||||
// Handles a click on a suggestion.
|
||||
click (e) {
|
||||
handleClick (e) {
|
||||
const {
|
||||
index,
|
||||
onClick,
|
||||
@ -40,7 +40,7 @@ export default class ComposerTextareaSuggestionsItem extends React.Component {
|
||||
|
||||
// Rendering.
|
||||
render () {
|
||||
const { click } = this.handlers;
|
||||
const { handleClick } = this.handlers;
|
||||
const {
|
||||
selected,
|
||||
suggestion,
|
||||
@ -51,7 +51,7 @@ export default class ComposerTextareaSuggestionsItem extends React.Component {
|
||||
return (
|
||||
<div
|
||||
className={computedClass}
|
||||
onMouseDown={click}
|
||||
onMouseDown={handleClick}
|
||||
role='button'
|
||||
tabIndex='0'
|
||||
>
|
||||
|
Reference in New Issue
Block a user