mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Update loading pre-bundled message
Summary: Updated the message from > Loading from pre-bundled file to > Connect to Metro to develop JavaScript I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro" Reviewed By: yungsters, cpojer Differential Revision: D16427501 fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7
This commit is contained in:
committed by
Facebook Github Bot
parent
2e8ecab583
commit
eb92f8181f
@@ -89,6 +89,13 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Add the default packager name
|
||||
*/
|
||||
#ifndef RCT_PACKAGER_NAME
|
||||
#define RCT_PACKAGER_NAME @"Metro"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* By default, only raise an NSAssertion in debug mode
|
||||
* (custom assert functions will still be called).
|
||||
|
||||
@@ -130,22 +130,22 @@ RCT_EXPORT_METHOD(hide)
|
||||
{
|
||||
UIColor *color;
|
||||
UIColor *backgroundColor;
|
||||
NSString *source;
|
||||
NSString *message;
|
||||
if (URL.fileURL) {
|
||||
// If dev mode is not enabled, we don't want to show this kind of notification
|
||||
#if !RCT_DEV
|
||||
return;
|
||||
#endif
|
||||
color = [UIColor grayColor];
|
||||
color = [UIColor whiteColor];
|
||||
backgroundColor = [UIColor blackColor];
|
||||
source = @"pre-bundled file";
|
||||
message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME];
|
||||
} else {
|
||||
color = [UIColor whiteColor];
|
||||
backgroundColor = [UIColor colorWithHue:1./3 saturation:1 brightness:.35 alpha:1];
|
||||
source = [NSString stringWithFormat:@"%@:%@", URL.host, URL.port];
|
||||
message = [NSString stringWithFormat:@"Loading from %@:%@...", URL.host, URL.port];
|
||||
}
|
||||
|
||||
[self showMessage:[NSString stringWithFormat:@"Loading from %@...", source]
|
||||
[self showMessage:message
|
||||
color:color
|
||||
backgroundColor:backgroundColor];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user