Skip to content

Commit

Permalink
If color scheme is "dark", setting modal backgroundcolor to black (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetterRuud authored Dec 3, 2020
1 parent 26a4c14 commit d5ccbb1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/styles.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -23,7 +25,7 @@ export default StyleSheet.create({

marginTop: 'auto',

backgroundColor: '#fff',
backgroundColor: colorScheme === 'dark' ? '#000' : '#fff',
borderTopLeftRadius: 12,
borderTopRightRadius: 12,

Expand Down

0 comments on commit d5ccbb1

Please sign in to comment.