Files
react-native/Libraries/Utilities/LoadingView.ios.js
T
Rick Hanlon 3729fe8de0 Update loading banner text and colors
Summary:
This diff updates the loading banner text and color on iOS for better UX.

Flow before:
- Loading from localhost:8081...
- Loading 20% (1000/5000)...
- Downloading JavaScript Bundle 20% (10/50)
- Downloading JavaScript Bundle...

After:
- Loading from Metro...
- Bundling 20%...
- Downloading 20%...
- Downloading...

Changelog: [Added] [iOS] Updated loading banner messages and color

Reviewed By: PeteTheHeat

Differential Revision: D21279939

fbshipit-source-id: fd7d90f85e25ce175a87087dfccf2180d49e3e98
2020-04-28 23:20:17 -07:00

40 lines
1021 B
JavaScript

/**
* 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 loadColor = processColor('#404040');
const refreshColor = processColor('#2584e8');
const white = processColor('#ffffff');
NativeDevLoadingView.showMessage(
message,
typeof white === 'number' ? white : null,
type && type === 'load'
? typeof loadColor === 'number'
? loadColor
: null
: typeof refreshColor === 'number'
? refreshColor
: null,
);
}
},
hide() {
NativeDevLoadingView && NativeDevLoadingView.hide();
},
};