Skip to content

Commit

Permalink
Enforce use of custom StatusBar implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jun 9, 2023
1 parent 5dbe02e commit 722ef00
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ module.exports = {
importNames: ['TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'],
message: 'Please use PressableWithFeedback and/or PressableWithoutFeedback from src/components/Pressable instead',
},
{
name: 'react-native',
importNames: ['StatusBar'],
message: 'Please use StatusBar from src/libs/StatusBar instead',
},
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomStatusBar/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {StatusBar} from 'react-native';
import StatusBar from '../../libs/StatusBar';

export default class CustomStatusBar extends React.Component {
componentDidMount() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomStatusBar/index.web.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {StatusBar} from 'react-native';
import StatusBar from '../../libs/StatusBar';
import themeColors from '../../styles/themes/default';

export default class CustomStatusBar extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion src/components/KeyboardSpacer/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* view up with the keyboard allowing the user to see what they are typing.
*/
import React from 'react';
import {StatusBar} from 'react-native';
import StatusBar from '../../libs/StatusBar';
import BaseKeyboardSpacer from './BaseKeyboardSpacer';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';

Expand Down
1 change: 1 addition & 0 deletions src/libs/StatusBar/index.android.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-restricted-imports
import {StatusBar} from 'react-native';

// Only has custom web implementation
Expand Down
1 change: 1 addition & 0 deletions src/libs/StatusBar/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-restricted-imports
import {StatusBar} from 'react-native';

// Only has custom web implementation
Expand Down
1 change: 1 addition & 0 deletions src/libs/StatusBar/index.web.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-restricted-imports
import {StatusBar} from 'react-native';

StatusBar.getBackgroundColor = () => {
Expand Down

0 comments on commit 722ef00

Please sign in to comment.