File tree Expand file tree Collapse file tree
packages/react-native/Libraries/Components/StatusBar Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import type { ColorValue } from '../../StyleSheet/StyleSheet' ;
1212
1313import type { EventSubscription } from '../../vendor/emitter/EventEmitter' ;
14- import {
15- getColorScheme ,
16- addChangeListener as addColorSchemeChangeListener ,
17- } from '../../Utilities/Appearance' ;
14+ import * as Appearance from '../../Utilities/Appearance' ;
1815import processColor from '../../StyleSheet/processColor' ;
1916import Platform from '../../Utilities/Platform' ;
2017import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid' ;
@@ -147,7 +144,9 @@ type StackProps = {
147144 * the current color scheme.
148145 */
149146function getAutoBarStyle ( ) : 'light-content' | 'dark-content' {
150- return getColorScheme ( ) === 'dark' ? 'light-content' : 'dark-content' ;
147+ return Appearance . getColorScheme ( ) === 'dark'
148+ ? 'light-content'
149+ : 'dark-content' ;
151150}
152151
153152/**
@@ -444,7 +443,7 @@ class StatusBar extends React.Component<StatusBarProps> {
444443 if ( StatusBar . _mountedCount === 0 ) {
445444 // Re-run the native update when the system color scheme changes so any
446445 // `barStyle: 'auto'` entries resolve to the new appropriate value.
447- StatusBar . _appearanceSubscription = addColorSchemeChangeListener ( ( ) => {
446+ StatusBar . _appearanceSubscription = Appearance . addChangeListener ( ( ) => {
448447 StatusBar . _updatePropsStack ( ) ;
449448 } ) ;
450449 }
You can’t perform that action at this time.
0 commit comments