Skip to content

Commit

Permalink
[iOS] Use react native 0.62 hook for dark mode (#21455)
Browse files Browse the repository at this point in the history
  • Loading branch information
marecar3 authored Apr 13, 2020
1 parent ce61e66 commit 5ca6800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
/**
* External dependencies
*/
import { useDarkModeContext, eventEmitter } from 'react-native-dark-mode';

// Conditional needed to pass UI Tests on CI
if ( eventEmitter.setMaxListeners ) {
eventEmitter.setMaxListeners( 150 );
}
import { useColorScheme } from 'react-native';

/**
* Returns the color scheme value when it changes. Possible values: [ 'light', 'dark' ]
*
* @return {string} return current color scheme.
*/
const usePreferredColorScheme = useDarkModeContext;
const usePreferredColorScheme = useColorScheme;

export default usePreferredColorScheme;
10 changes: 0 additions & 10 deletions test/native/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ jest.mock( 'react-native-gutenberg-bridge', () => {
};
} );

jest.mock( 'react-native-dark-mode', () => {
return {
initialMode: 'light',
eventEmitter: {
on: jest.fn(),
},
useDarkModeContext: () => 'light',
};
} );

jest.mock( 'react-native-modal', () => () => 'Modal' );

jest.mock( 'react-native-hr', () => () => 'Hr' );
Expand Down

0 comments on commit 5ca6800

Please sign in to comment.