LoadingView.ios.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow strict-local
  9. */
  10. 'use strict';
  11. import processColor from '../StyleSheet/processColor';
  12. import NativeDevLoadingView from './NativeDevLoadingView';
  13. module.exports = {
  14. showMessage(message: string, type: 'load' | 'refresh') {
  15. if (NativeDevLoadingView) {
  16. const green = processColor('#005a00');
  17. const blue = processColor('#2584e8');
  18. const white = processColor('#ffffff');
  19. NativeDevLoadingView.showMessage(
  20. message,
  21. // Use same colors as iOS "Personal Hotspot" bar.
  22. typeof white === 'number' ? white : null,
  23. type && type === 'load'
  24. ? typeof green === 'number'
  25. ? green
  26. : null
  27. : typeof blue === 'number'
  28. ? blue
  29. : null,
  30. );
  31. }
  32. },
  33. hide() {
  34. NativeDevLoadingView && NativeDevLoadingView.hide();
  35. },
  36. };