react-native-flip
Version:
20 lines (16 loc) • 550 B
text/typescript
import { StatusBarStyle } from './StatusBar.types';
export default function styleToBarStyle(
style: StatusBarStyle = 'auto',
colorScheme: 'light' | 'dark'
): 'light-content' | 'dark-content' {
if (!colorScheme) {
colorScheme = 'light';
}
let resolvedStyle = style;
if (style === 'auto') {
resolvedStyle = colorScheme === 'light' ? 'dark' : 'light';
} else if (style === 'inverted') {
resolvedStyle = colorScheme === 'light' ? 'light' : 'dark';
}
return resolvedStyle === 'light' ? 'light-content' : 'dark-content';
}