Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

LoadConfigOverlay.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import { SafeAreaView, Text, View } from 'react-native';
  4. import { translate } from '../../../base/i18n';
  5. import { LoadingIndicator } from '../../../base/react';
  6. import { StyleType } from '../../../base/styles';
  7. import OverlayFrame from './OverlayFrame';
  8. import styles, { TEXT_COLOR } from './styles';
  9. type Props = {
  10. /**
  11. * The color schemed style of the component.
  12. */
  13. _styles: StyleType,
  14. /**
  15. * The Function to be invoked to translate i18n keys.
  16. */
  17. t: Function
  18. };
  19. /**
  20. * Implements an overlay to tell the user that there is an operation in progress in the background during connect
  21. * so then the app doesn't seem hung.
  22. */
  23. class LoadConfigOverlay extends PureComponent<Props> {
  24. /**
  25. * Determines whether this overlay needs to be rendered (according to a
  26. * specific redux state). Called by {@link OverlayContainer}.
  27. *
  28. * @param {Object} state - The redux state.
  29. * @returns {boolean} - If this overlay needs to be rendered, {@code true};
  30. * {@code false}, otherwise.
  31. */
  32. static needsRender(state: Object) {
  33. return Boolean(state['features/overlay'].loadConfigOverlayVisible);
  34. }
  35. /**
  36. * Implements React's {@link Component#render()}.
  37. *
  38. * @inheritdoc
  39. * @returns {ReactElement}
  40. */
  41. render() {
  42. return (
  43. <OverlayFrame>
  44. <View style = { styles.loadingOverlayWrapper }>
  45. <SafeAreaView>
  46. <LoadingIndicator
  47. color = { TEXT_COLOR }
  48. size = 'large'
  49. style = { styles.connectIndicator } />
  50. <Text style = { styles.loadingOverlayText }>
  51. { this.props.t('connectingOverlay.joiningRoom') }
  52. </Text>
  53. </SafeAreaView>
  54. </View>
  55. </OverlayFrame>
  56. );
  57. }
  58. }
  59. export default translate(LoadConfigOverlay);