Skip to content

Commit

Permalink
Merge pull request #3579 from Expensify/Rory-FixRandomWarnings
Browse files Browse the repository at this point in the history
Fix random warnings
  • Loading branch information
roryabraham authored Jun 14, 2021
2 parents bdf2144 + bb4d136 commit d0e5fb1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Expensify.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {PureComponent} from 'react';
import {View, StatusBar, AppState} from 'react-native';
import {View, AppState} from 'react-native';
import Onyx, {withOnyx} from 'react-native-onyx';

import BootSplash from './libs/BootSplash';
import StatusBar from './libs/StatusBar';
import listenToStorageEvents from './libs/listenToStorageEvents';
import * as ActiveClientManager from './libs/ActiveClientManager';
import ONYXKEYS from './ONYXKEYS';
Expand Down
3 changes: 2 additions & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import OpacityView from './OpacityView';

const propTypes = {
/** The text for the button label */
text: PropTypes.string.isRequired,
text: PropTypes.string,

/** Indicates whether the button should be disabled and in the loading state */
isLoading: PropTypes.bool,
Expand Down Expand Up @@ -44,6 +44,7 @@ const propTypes = {
};

const defaultProps = {
text: '',
isLoading: false,
isDisabled: false,
onPress: () => {},
Expand Down
4 changes: 4 additions & 0 deletions src/libs/StatusBar/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {StatusBar} from 'react-native';

// Just export StatusBar – no changes.
export default StatusBar;
6 changes: 6 additions & 0 deletions src/libs/StatusBar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {StatusBar} from 'react-native';

// Overwrite setTranslucent to suppress a warning on iOS
StatusBar.setTranslucent = () => {};

export default StatusBar;
4 changes: 2 additions & 2 deletions src/pages/settings/AboutPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const AboutPage = ({translate, session}) => {
</View>
{menuItems.map(item => (
<MenuItem
key={item.title}
key={item.translationKey}
title={translate(item.translationKey)}
icon={item.icon}
iconRight={item.iconRight}
Expand Down Expand Up @@ -156,7 +156,7 @@ const AboutPage = ({translate, session}) => {
};

AboutPage.propTypes = propTypes;
AboutPage.displayName = 'PreferencesPage';
AboutPage.displayName = 'AboutPage';

export default compose(
withLocalize,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/AppDownloadLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const AppDownloadLinksPage = ({translate}) => {
<ScrollView style={[styles.mt5]} bounces={false}>
{menuItems.map(item => (
<MenuItem
key={item.title}
key={item.translationKey}
title={translate(item.translationKey)}
icon={item.icon}
iconRight={item.iconRight}
Expand All @@ -63,7 +63,7 @@ const AppDownloadLinksPage = ({translate}) => {
};

AppDownloadLinksPage.propTypes = propTypes;
AppDownloadLinksPage.displayName = 'PreferencesPage';
AppDownloadLinksPage.displayName = 'AppDownloadLinksPage';

export default compose(
withLocalize,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/InitialPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ const InitialSettingsPage = ({
</View>
{menuItems.map(item => (
<MenuItem
key={item.title}
key={item.translationKey}
title={translate(item.translationKey)}
icon={item.icon}
onPress={() => item.action()}
onPress={item.action}
shouldShowRightIcon
/>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Profile/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class ProfilePage extends Component {
<Checkbox
label={this.props.translate('profilePage.setMyTimezoneAutomatically')}
isChecked={this.state.isAutomaticTimezone}
onClick={this.setAutomaticTimezone}
onPress={this.setAutomaticTimezone}
/>
</ScrollView>
<FixedFooter>
Expand Down

0 comments on commit d0e5fb1

Please sign in to comment.