Skip to content

Commit 1271676

Browse files
committed
PR feedback
1 parent 32ad729 commit 1271676

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

packages/react-native/React/CoreModules/RCTLogBoxView.mm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,10 @@ - (instancetype)initWithWindow:(RCTPlatformWindow *)window surfacePresenter:(id<
7979
#if !TARGET_OS_OSX // [macOS]
8080
self = [super initWithWindowScene:window.windowScene];
8181
#else // [macOS
82-
self = [super
83-
initWithContentRect:NSMakeRect(0, 0, 600, 800)
84-
styleMask:NSWindowStyleMaskBorderless | NSWindowStyleMaskFullSizeContentView
85-
backing:NSBackingStoreBuffered
86-
defer:YES];
82+
self = [super initWithContentRect:NSMakeRect(0, 0, 600, 800)
83+
styleMask:NSWindowStyleMaskBorderless | NSWindowStyleMaskFullSizeContentView
84+
backing:NSBackingStoreBuffered
85+
defer:YES];
8786
_window = window;
8887
#endif // macOS]
8988

packages/react-native/React/DevSupport/RCTPausedInDebuggerOverlayController.mm

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ - (void)viewDidLoad
4848
messageLabel.font = [UIFont boldSystemFontOfSize:16];
4949
messageLabel.textColor = [RCTUIColor blackColor]; // [macOS]
5050
messageLabel.translatesAutoresizingMaskIntoConstraints = NO;
51-
5251
RCTUIView *messageContainer = [[RCTUIView alloc] init]; // [macOS]
5352
[messageContainer addSubview:messageLabel];
5453
[NSLayoutConstraint activateConstraints:@[
@@ -85,13 +84,13 @@ - (void)viewDidLoad
8584
#if !TARGET_OS_OSX // [macOS]
8685
UIStackView *stackView = [[UIStackView alloc] initWithArrangedSubviews:@[ messageContainer, resumeButton ]];
8786
stackView.backgroundColor = [UIColor colorWithRed:1 green:1 blue:0.757 alpha:1];
88-
stackView.axis = UILayoutConstraintAxisHorizontal;
89-
stackView.distribution = UIStackViewDistributionFill;
90-
stackView.alignment = UIStackViewAlignmentCenter;
9187
stackView.layer.cornerRadius = 12;
9288
stackView.layer.borderWidth = 2;
9389
stackView.layer.borderColor = [UIColor colorWithRed:0.71 green:0.71 blue:0.62 alpha:1].CGColor;
9490
stackView.translatesAutoresizingMaskIntoConstraints = NO;
91+
stackView.axis = UILayoutConstraintAxisHorizontal;
92+
stackView.distribution = UIStackViewDistributionFill;
93+
stackView.alignment = UIStackViewAlignmentCenter;
9594

9695
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
9796
action:@selector(handleResume:)];
@@ -101,10 +100,10 @@ - (void)viewDidLoad
101100
NSStackView *stackView = [NSStackView stackViewWithViews:@[ messageContainer, resumeButton ]];
102101
stackView.wantsLayer = YES;
103102
stackView.layer.backgroundColor = [NSColor colorWithRed:1 green:1 blue:0.757 alpha:1].CGColor;
103+
stackView.translatesAutoresizingMaskIntoConstraints = NO;
104104
stackView.orientation = NSUserInterfaceLayoutOrientationHorizontal;
105105
stackView.distribution = NSStackViewDistributionFill;
106106
stackView.alignment = NSLayoutAttributeCenterY;
107-
stackView.translatesAutoresizingMaskIntoConstraints = NO;
108107

109108
NSClickGestureRecognizer *gestureRecognizer = [[NSClickGestureRecognizer alloc] initWithTarget:self
110109
action:@selector(handleResume:)];
@@ -116,11 +115,7 @@ - (void)viewDidLoad
116115

117116
[NSLayoutConstraint activateConstraints:@[
118117
[stackView.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor constant:12],
119-
[stackView.topAnchor constraintEqualToAnchor:self.view.topAnchor constant:20],
120-
[stackView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:20],
121-
[stackView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-20],
122-
[stackView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-20],
123-
[stackView.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor],
118+
[stackView.centerXAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.centerXAnchor],
124119
]];
125120
#else
126121
[self setView:stackView];
@@ -176,15 +171,17 @@ - (void)showWithMessage:(NSString *)message onResume:(void (^)(void))onResume
176171
[self hide];
177172

178173
RCTPausedInDebuggerViewController *view = [[RCTPausedInDebuggerViewController alloc] init];
174+
#if !TARGET_OS_OSX // [macOS]
175+
view.modalPresentationStyle = UIModalPresentationOverFullScreen;
179176
view.message = message;
180177
view.onResume = onResume;
181178

182-
#if !TARGET_OS_OSX // [macOS]
183-
view.modalPresentationStyle = UIModalPresentationOverFullScreen;
184179
[self.alertWindow makeKeyAndVisible];
185180
[self.alertWindow.rootViewController presentViewController:view animated:NO completion:nil];
186181
#else // [macOS]
187182
self.alertWindow.contentViewController = view;
183+
view.message = message;
184+
view.onResume = onResume;
188185

189186
NSWindow *parentWindow = RCTKeyWindow();
190187
if (![[parentWindow sheets] doesContain:self->_alertWindow]) {
@@ -199,8 +196,8 @@ - (void)hide
199196
{
200197
#if !TARGET_OS_OSX // [macOS]
201198
[_alertWindow setHidden:YES];
199+
202200
_alertWindow.windowScene = nil;
203-
_alertWindow = nil;
204201
#else // [macOS]
205202
NSWindow *parentWindow = RCTKeyWindow();
206203
if (parentWindow) {
@@ -211,8 +208,9 @@ - (void)hide
211208
}
212209
}
213210
}
214-
_alertWindow = nil;
215211
#endif // macOS]
212+
213+
_alertWindow = nil;
216214
}
217215

218216
@end

0 commit comments

Comments
 (0)