Skip to content

Commit

Permalink
Remove yellow boxes from title and button components in debug (#5819)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd authored Jan 1, 2020
1 parent 5a6fc7f commit b82d87f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/ios/RCTHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ + (BOOL)removeYellowBox:(RCTRootView *)reactRootView {
[view.backgroundColor getRed:&r green:&g blue:&b alpha:&a];

//identify the yellow view by its hard-coded color and height
if((lrint(r * 255) == 250) && (lrint(g * 255) == 186) && (lrint(b * 255) == 48) && (lrint(a * 100) == 95) && (view.frame.size.height == 46))
if((lrint(r * 255) == 250) && (lrint(g * 255) == 186) && (lrint(b * 255) == 48) && (lrint(a * 100) == 95) && (view.frame.size.height == 48))
{
UIView *yelloboxParentView = view;
while (view.superview != nil)
Expand Down
13 changes: 7 additions & 6 deletions lib/ios/RNNReactView.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge moduleName:(NSString *)module
return self;
}

- (void)layoutSubviews {
[super layoutSubviews];
#ifdef DEBUG
[RCTHelpers removeYellowBox:self];
#endif
}

- (void)contentDidAppear:(NSNotification *)notification {
#ifdef DEBUG
if ([((RNNReactView *)notification.object).moduleName isEqualToString:self.moduleName]) {
[RCTHelpers removeYellowBox:self];
}
#endif

RNNReactView* appearedView = notification.object;

if (_reactViewReadyBlock && [appearedView.appProperties[@"componentId"] isEqual:self.componentId]) {
Expand Down

0 comments on commit b82d87f

Please sign in to comment.