From a49e590e7c5471d72947c95589eb809811022c2a Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 24 Sep 2018 19:01:54 -0500 Subject: [PATCH] feat(LoadingIndicator): Implementation for web. --- .../components/native/LoadingIndicator.js | 21 +++++++++++++++---- .../react/components/web/LoadingIndicator.js | 3 +++ .../base/react/components/web/index.js | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 react/features/base/react/components/web/LoadingIndicator.js diff --git a/react/features/base/react/components/native/LoadingIndicator.js b/react/features/base/react/components/native/LoadingIndicator.js index 2cd2359e6..08085e2c9 100644 --- a/react/features/base/react/components/native/LoadingIndicator.js +++ b/react/features/base/react/components/native/LoadingIndicator.js @@ -11,7 +11,7 @@ type Props = { * Prop to set the size of the indicator. This is the same as the * prop of the native component. */ - size: 'large' | 'small' + size: 'large' | 'medium' | 'small' }; /** @@ -27,12 +27,25 @@ export default class LoadingIndicator extends Component { * @returns {ReactElement} */ render() { - return ( + let { size = 'large' } = this.props; + + if (size === 'medium') { + size = 'large'; + } + + const props = { + animating: true, + color: ColorPalette.white, + ...this.props, + size + }; + + return (// $FlowFixMe + { ...props } + size = { size } /> ); } } diff --git a/react/features/base/react/components/web/LoadingIndicator.js b/react/features/base/react/components/web/LoadingIndicator.js new file mode 100644 index 000000000..0ae9c2e3a --- /dev/null +++ b/react/features/base/react/components/web/LoadingIndicator.js @@ -0,0 +1,3 @@ +/* @flow */ + +export { default } from '@atlaskit/spinner'; diff --git a/react/features/base/react/components/web/index.js b/react/features/base/react/components/web/index.js index a6ab98d66..90e892131 100644 --- a/react/features/base/react/components/web/index.js +++ b/react/features/base/react/components/web/index.js @@ -1,4 +1,5 @@ export { default as Container } from './Container'; +export { default as LoadingIndicator } from './LoadingIndicator'; export { default as MultiSelectAutocomplete } from './MultiSelectAutocomplete'; export { default as NavigateSectionListEmptyComponent } from './NavigateSectionListEmptyComponent';