From d5ccbb1076527b4272b2a64ec42c15b10176d53b Mon Sep 17 00:00:00 2001 From: Petter Date: Thu, 3 Dec 2020 09:01:39 +0100 Subject: [PATCH] If color scheme is "dark", setting modal backgroundcolor to black (#278) --- src/styles.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/styles.ts b/src/styles.ts index ea68362b..ce68a9f0 100644 --- a/src/styles.ts +++ b/src/styles.ts @@ -1,9 +1,11 @@ -import { StyleSheet, Dimensions } from 'react-native'; +import { StyleSheet, Dimensions, Appearance } from 'react-native'; import { isWeb } from './utils/devices'; const { height } = Dimensions.get('window'); +const colorScheme = Appearance.getColorScheme(); + export default StyleSheet.create({ modalize: { position: 'absolute', @@ -23,7 +25,7 @@ export default StyleSheet.create({ marginTop: 'auto', - backgroundColor: '#fff', + backgroundColor: colorScheme === 'dark' ? '#000' : '#fff', borderTopLeftRadius: 12, borderTopRightRadius: 12,