GT2/Ejectable/node_modules/react-native/Libraries/Utilities/LoadingView.ios.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

2021-08-16 00:14:59 +00:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
*/
'use strict';
import processColor from '../StyleSheet/processColor';
import NativeDevLoadingView from './NativeDevLoadingView';
module.exports = {
showMessage(message: string, type: 'load' | 'refresh') {
if (NativeDevLoadingView) {
const green = processColor('#005a00');
const blue = processColor('#2584e8');
const white = processColor('#ffffff');
NativeDevLoadingView.showMessage(
message,
// Use same colors as iOS "Personal Hotspot" bar.
typeof white === 'number' ? white : null,
type && type === 'load'
? typeof green === 'number'
? green
: null
: typeof blue === 'number'
? blue
: null,
);
}
},
hide() {
NativeDevLoadingView && NativeDevLoadingView.hide();
},
};