From 6e4922317c4c47d66e96071dd68dca813dbed0b0 Mon Sep 17 00:00:00 2001 From: Jure Triglav <juretriglav@gmail.com> Date: Wed, 29 Jul 2020 11:05:43 +0200 Subject: [PATCH] feat: use Spinner loading component --- app/components/component-chat/src/Messages/Messages.jsx | 3 ++- app/components/component-chat/src/Messages/style.js | 1 + .../component-chat/src/SuperChatInput/SuperChatInput.jsx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/component-chat/src/Messages/Messages.jsx b/app/components/component-chat/src/Messages/Messages.jsx index 89a2fa0bbe..4ede310a83 100644 --- a/app/components/component-chat/src/Messages/Messages.jsx +++ b/app/components/component-chat/src/Messages/Messages.jsx @@ -19,6 +19,7 @@ import { InnerMessageContainer, Byline, Placeholder, + Spinner, } from './style' const GET_MESSAGES = gql` @@ -133,7 +134,7 @@ const Messages = ({ channelId }) => { } }) - if (loading) return 'Loading...' + if (loading) return <Spinner /> if (error) return JSON.stringify(error) const firstMessage = data.messages.edges[0] diff --git a/app/components/component-chat/src/Messages/style.js b/app/components/component-chat/src/Messages/style.js index 022e90e840..9cc7b11d8c 100644 --- a/app/components/component-chat/src/Messages/style.js +++ b/app/components/component-chat/src/Messages/style.js @@ -3,6 +3,7 @@ import { th } from '@pubsweet/ui-toolkit' import { HorizontalRule } from '../../../../globals' +export { Spinner } from '../../../shared' export const Timestamp = styled(HorizontalRule)` margin: 24px 0; text-align: center; diff --git a/app/components/component-chat/src/SuperChatInput/SuperChatInput.jsx b/app/components/component-chat/src/SuperChatInput/SuperChatInput.jsx index f84d21a878..275e2b2d1a 100644 --- a/app/components/component-chat/src/SuperChatInput/SuperChatInput.jsx +++ b/app/components/component-chat/src/SuperChatInput/SuperChatInput.jsx @@ -374,7 +374,7 @@ const SuperChatInput = props => { // onFocus={props.onFocus} onKeyDown={handleKeyPress} placeholder="Your message here..." - // staticSuggestions={props.participants} + staticSuggestions={props.participants} value={text} /> </InputWrapper> -- GitLab