summaryrefslogtreecommitdiffstats
path: root/webapp/components/suggestion/suggestion_list.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/suggestion/suggestion_list.jsx')
-rw-r--r--webapp/components/suggestion/suggestion_list.jsx22
1 files changed, 19 insertions, 3 deletions
diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx
index 59f0d02f8..64e8713c5 100644
--- a/webapp/components/suggestion/suggestion_list.jsx
+++ b/webapp/components/suggestion/suggestion_list.jsx
@@ -1,14 +1,14 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+import SuggestionStore from 'stores/suggestion_store.jsx';
+
import $ from 'jquery';
-import PropTypes from 'prop-types';
import React from 'react';
import ReactDOM from 'react-dom';
+import PropTypes from 'prop-types';
import {FormattedMessage} from 'react-intl';
-import SuggestionStore from 'stores/suggestion_store.jsx';
-
export default class SuggestionList extends React.Component {
static propTypes = {
suggestionId: PropTypes.string.isRequired,
@@ -111,6 +111,17 @@ export default class SuggestionList extends React.Component {
);
}
+ renderLoading(type) {
+ return (
+ <div
+ key={type + '-loading'}
+ className='suggestion-loader'
+ >
+ <i className='fa fa-spinner fa-pulse fa-fw margin-bottom'/>
+ </div>
+ );
+ }
+
render() {
if (this.state.items.length === 0) {
return null;
@@ -131,6 +142,11 @@ export default class SuggestionList extends React.Component {
lastType = item.type;
}
+ if (item.loading) {
+ items.push(this.renderLoading(item.type));
+ continue;
+ }
+
items.push(
<Component
key={term}