Skip to content

Commit 576ddfb

Browse files
gorhomfacebook-github-bot
authored andcommitted
Dark mode support for RCTPerfMonitor (#28130)
Summary: Hi There 👋, While I'm developing on iOS with dark appearance enabled, i notice that `Pref Monitor` view doesn't support dark mode yet, so here is the PR to fix it :) ## Changelog [iOS] [Fixed] - Fix Pref Monitor in dark appearance Pull Request resolved: #28130 Test Plan: Run any React Native app on iOS > Turn on dark appearance ### Before ![Before](https://user-images.githubusercontent.com/4061838/74872974-8b75b600-535e-11ea-8550-763a598547ec.png) ### After ![After](https://user-images.githubusercontent.com/4061838/74872978-8ca6e300-535e-11ea-9862-4d3014e849f7.png) Reviewed By: RSNara Differential Revision: D20080019 Pulled By: PeteTheHeat fbshipit-source-id: 9365daa3f7193a11760bc1372b8de2c3896def5c
1 parent 6a9a76e commit 576ddfb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

React/CoreModules/RCTPerfMonitor.mm

+8-1
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,19 @@ - (UIView *)container
197197
{
198198
if (!_container) {
199199
_container = [[UIView alloc] initWithFrame:CGRectMake(10, 25, 180, RCTPerfMonitorBarHeight)];
200-
_container.backgroundColor = UIColor.whiteColor;
201200
_container.layer.borderWidth = 2;
202201
_container.layer.borderColor = [UIColor lightGrayColor].CGColor;
203202
[_container addGestureRecognizer:self.gestureRecognizer];
204203
[_container addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
205204
action:@selector(tap)]];
205+
206+
_container.backgroundColor = [UIColor whiteColor];
207+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
208+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
209+
if (@available(iOS 13.0, *)) {
210+
_container.backgroundColor = [UIColor systemBackgroundColor];
211+
}
212+
#endif
206213
}
207214

208215
return _container;

0 commit comments

Comments
 (0)