Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/react-native/React/CoreModules/RCTDevLoadingView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
[self->_label.bottomAnchor constraintEqualToAnchor:self->_container.bottomAnchor constant:-5],
]];
#else // [macOS
self->_window.contentView = [[NSView alloc] init];
[self->_window.contentView addSubview:self->_container];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this invalidate line 152? Should we doing it there instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have completed the modifications according to your suggestions.

// Container constraints
[NSLayoutConstraint activateConstraints:@[
[self->_container.topAnchor constraintEqualToAnchor:self->_window.contentView.topAnchor],
[self->_container.leadingAnchor constraintEqualToAnchor:self->_window.contentView.leadingAnchor],
[self->_container.trailingAnchor constraintEqualToAnchor:self->_window.contentView.trailingAnchor],
[self->_container.bottomAnchor constraintEqualToAnchor:self->_window.contentView.bottomAnchor],

// Label constraints
[self->_label.centerXAnchor constraintEqualToAnchor:self->_container.centerXAnchor],
[self->_label.centerYAnchor constraintEqualToAnchor:self->_container.centerYAnchor],
[self->_label.leadingAnchor constraintGreaterThanOrEqualToAnchor:self->_container.leadingAnchor constant:10],
[self->_label.trailingAnchor constraintLessThanOrEqualToAnchor:self->_container.trailingAnchor constant:-10],
]];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can share a bunch of these constraints with the iOS block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have completed the modifications according to your suggestions.


if (![[RCTKeyWindow() sheets] doesContain:self->_window]) {
[RCTKeyWindow() beginSheet:self->_window completionHandler:^(NSModalResponse returnCode) {
[self->_window orderOut:self];
Expand Down