Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix random warnings #3579

Merged
merged 3 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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