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

[No QA] Add missing displayName. Remove unnecessary displayName. #6003

Merged
merged 2 commits into from
Oct 25, 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
2 changes: 1 addition & 1 deletion src/components/AttachmentPicker/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class AttachmentPicker extends Component {

AttachmentPicker.propTypes = propTypes;
AttachmentPicker.defaultProps = defaultProps;
AttachmentPicker.displayName = 'AttachmentPicker';

export default compose(
withWindowDimensions,
withLocalize,
Expand Down
1 change: 0 additions & 1 deletion src/components/AvatarWithIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@ class AvatarWithIndicator extends PureComponent {

AvatarWithIndicator.defaultProps = defaultProps;
AvatarWithIndicator.propTypes = propTypes;
AvatarWithIndicator.displayName = 'AvatarWithIndicator';
export default AvatarWithIndicator;
1 change: 0 additions & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,5 @@ class Button extends Component {

Button.propTypes = propTypes;
Button.defaultProps = defaultProps;
Button.displayName = 'Button';

export default Button;
1 change: 0 additions & 1 deletion src/components/ButtonWithMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,5 @@ class ButtonWithMenu extends PureComponent {

ButtonWithMenu.propTypes = propTypes;
ButtonWithMenu.defaultProps = defaultProps;
ButtonWithMenu.displayName = 'ButtonWithMenu';

export default ButtonWithMenu;
1 change: 1 addition & 0 deletions src/components/CardOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import {View} from 'react-native';
import styles from '../styles/styles';

const CardOverlay = () => <View style={styles.cardOverlay} />;
CardOverlay.displayName = 'CardOverlay';

export default CardOverlay;
1 change: 0 additions & 1 deletion src/components/ContextMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,5 @@ class ContextMenuItem extends Component {

ContextMenuItem.propTypes = propTypes;
ContextMenuItem.defaultProps = defaultProps;
ContextMenuItem.displayName = 'ContextMenuItem';

export default ContextMenuItem;
1 change: 0 additions & 1 deletion src/components/DisplayNames/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,5 @@ class DisplayNames extends PureComponent {
}
DisplayNames.propTypes = propTypes;
DisplayNames.defaultProps = defaultProps;
DisplayNames.displayName = 'DisplayNames';

export default DisplayNames;
13 changes: 6 additions & 7 deletions src/components/FAB/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import FAB from './FAB';
import fabPropTypes from './fabPropTypes';

// KeyboardAvoidingView only need in IOS so that's the reason make platform specific FAB component.
function Fab({onPress, isActive}) {
return (
<KeyboardAvoidingView behavior="position">
<FAB onPress={onPress} isActive={isActive} />
</KeyboardAvoidingView>
);
}
const Fab = ({onPress, isActive}) => (
<KeyboardAvoidingView behavior="position">
<FAB onPress={onPress} isActive={isActive} />
</KeyboardAvoidingView>
);

Fab.propTypes = fabPropTypes;
Fab.displayName = 'Fab';
export default Fab;
2 changes: 2 additions & 0 deletions src/components/FormAlertWithSubmitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,6 @@ const FormAlertWithSubmitButton = ({

FormAlertWithSubmitButton.propTypes = propTypes;
FormAlertWithSubmitButton.defaultProps = defaultProps;
FormAlertWithSubmitButton.displayName = 'FormAlertWithSubmitButton';

export default withLocalize(FormAlertWithSubmitButton);
2 changes: 0 additions & 2 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const defaultProps = {
subtitle: '',
};
const Header = props => (


<View style={[styles.flex1, styles.flexRow]}>
<View style={[styles.flex1, styles.flexColumn]}>
<Text numberOfLines={2} style={[styles.headerText, styles.textLarge]}>
Expand Down
1 change: 1 addition & 0 deletions src/components/Hoverable/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ const Hoverable = (props) => {

Hoverable.propTypes = propTypes;
Hoverable.defaultProps = defaultProps;
Hoverable.displayName = 'Hoverable';

export default Hoverable;
1 change: 0 additions & 1 deletion src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ class IOUConfirmationList extends Component {
}
}

IOUConfirmationList.displayName = 'IOUConfirmPage';
IOUConfirmationList.propTypes = propTypes;
IOUConfirmationList.defaultProps = defaultProps;

Expand Down
1 change: 0 additions & 1 deletion src/components/ImageView/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,5 @@ class ImageView extends PureComponent {
}

ImageView.propTypes = propTypes;
ImageView.displayName = 'ImageView';

export default withWindowDimensions(ImageView);
2 changes: 1 addition & 1 deletion src/components/Modal/BaseModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class BaseModal extends PureComponent {

BaseModal.propTypes = propTypes;
BaseModal.defaultProps = defaultProps;
BaseModal.displayName = 'BaseModal';

export default React.forwardRef((props, ref) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<BaseModal {...props} forwardedRef={ref} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ class Modal extends Component {

Modal.propTypes = propTypes;
Modal.defaultProps = defaultProps;
Modal.displayName = 'Modal';

export default withWindowDimensions(Modal);
1 change: 0 additions & 1 deletion src/components/ReportTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class ReportTransaction extends Component {
}
}

ReportTransaction.displayName = 'ReportTransaction';
ReportTransaction.defaultProps = defaultProps;
ReportTransaction.propTypes = propTypes;
export default withOnyx({
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScreenWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ScreenWrapper extends React.Component {

ScreenWrapper.propTypes = propTypes;
ScreenWrapper.defaultProps = defaultProps;
ScreenWrapper.displayName = 'ScreenWrapper';

export default compose(
withNavigation,
withOnyx({
Expand Down
2 changes: 1 addition & 1 deletion src/components/SwipeableView/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ class SwipeableView extends PureComponent {
}

SwipeableView.propTypes = propTypes;
SwipeableView.displayName = 'SwipeableView';

export default SwipeableView;
1 change: 0 additions & 1 deletion src/components/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ class Switch extends Component {
}

Switch.propTypes = propTypes;
Switch.displayName = 'Switch';

export default Switch;
1 change: 0 additions & 1 deletion src/components/TextInputFocusable/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class TextInputFocusable extends React.Component {
}
}

TextInputFocusable.displayName = 'TextInputFocusable';
TextInputFocusable.propTypes = propTypes;
TextInputFocusable.defaultProps = defaultProps;

Expand Down
2 changes: 1 addition & 1 deletion src/components/VideoChatButtonAndMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class VideoChatButtonAndMenu extends Component {

VideoChatButtonAndMenu.propTypes = propTypes;
VideoChatButtonAndMenu.defaultProps = defaultProps;
VideoChatButtonAndMenu.displayName = 'VideoChatButtonAndMenu';

export default compose(
withWindowDimensions,
withLocalize,
Expand Down
1 change: 0 additions & 1 deletion src/libs/Navigation/AppNavigator/MainDrawerNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const defaultProps = {
betas: [],
};


/**
* Get the most recently accessed report for the user
*
Expand Down
5 changes: 4 additions & 1 deletion src/libs/Navigation/AppNavigator/PublicScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import defaultScreenOptions from './defaultScreenOptions';

const RootStack = createStackNavigator();

export default () => (
const PublicScreens = () => (
<RootStack.Navigator>
<RootStack.Screen
name={SCREENS.HOME}
Expand All @@ -27,3 +27,6 @@ export default () => (
/>
</RootStack.Navigator>
);

PublicScreens.displayName = 'PublicScreens';
export default PublicScreens;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {StackRouter} from '@react-navigation/routers';
import {StackView} from '@react-navigation/stack';
import ClickAwayHandler from './ClickAwayHandler';

const propTypes = {
children: PropTypes.node.isRequired,
};

const CustomRootStackNavigator = ({
children,
...rest
Expand Down Expand Up @@ -35,8 +39,7 @@ const CustomRootStackNavigator = ({
);
};

CustomRootStackNavigator.propTypes = {
children: PropTypes.node.isRequired,
};
CustomRootStackNavigator.propTypes = propTypes;
CustomRootStackNavigator.displayName = 'CustomRootStackNavigator';

export default createNavigatorFactory(CustomRootStackNavigator);
1 change: 1 addition & 0 deletions src/pages/AddPersonalBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ const AddPersonalBankAccountPage = props => (
);

AddPersonalBankAccountPage.propTypes = propTypes;
AddPersonalBankAccountPage.displayName = 'AddPersonalBankAccountPage';
export default withLocalize(AddPersonalBankAccountPage);
8 changes: 6 additions & 2 deletions src/pages/NotFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import ROUTES from '../ROUTES';
import withLocalize, {withLocalizePropTypes} from '../components/withLocalize';
import Text from '../components/Text';

const propTypes = {
...withLocalizePropTypes,
};

const NotFound = ({translations: {translate}}) => (
<>
<SafeAreaView
Expand All @@ -37,6 +41,6 @@ const NotFound = ({translations: {translate}}) => (
</>
);

NotFound.propTypes = {...withLocalizePropTypes};

NotFound.propTypes = propTypes;
NotFound.displayName = 'NotFound';
export default withLocalize(NotFound);
1 change: 1 addition & 0 deletions src/pages/ReimbursementAccount/IdentityForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@ const IdentityForm = ({

IdentityForm.propTypes = propTypes;
IdentityForm.defaultProps = defaultProps;
IdentityForm.displayName = 'IdentityForm';
export default withLocalize(IdentityForm);
1 change: 0 additions & 1 deletion src/pages/ReimbursementAccount/RequestorStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ class RequestorStep extends React.Component {
}

RequestorStep.propTypes = propTypes;
RequestorStep.displayName = 'RequestorStep';

export default compose(
withLocalize,
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ class ReportDetailsPage extends Component {
}
}

ReportDetailsPage.displayName = 'ReportDetailsPage';
ReportDetailsPage.propTypes = propTypes;

export default compose(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const ReportParticipantsPage = ({
};

ReportParticipantsPage.propTypes = propTypes;
ReportParticipantsPage.displayName = 'ParticipantsPage';
ReportParticipantsPage.displayName = 'ReportParticipantsPage';

export default compose(
withLocalize,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/RequestCallPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ class RequestCallPage extends Component {
}
}

RequestCallPage.displayName = 'RequestCallPage';
RequestCallPage.propTypes = propTypes;

export default compose(
withLocalize,
withOnyx({
Expand Down
1 change: 0 additions & 1 deletion src/pages/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ class SearchPage extends Component {
}

SearchPage.propTypes = propTypes;
SearchPage.displayName = 'SearchPage';

export default compose(
withLocalize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,5 @@ class PopoverReportActionContextMenu extends React.Component {
}

PopoverReportActionContextMenu.propTypes = propTypes;
PopoverReportActionContextMenu.displayName = 'PopoverReportActionContextMenu';

export default withLocalize(PopoverReportActionContextMenu);
1 change: 0 additions & 1 deletion src/pages/home/report/MarkerBadge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,5 @@ class MarkerBadge extends PureComponent {

MarkerBadge.propTypes = propTypes;
MarkerBadge.defaultProps = defaultProps;
MarkerBadge.displayName = 'MarkerBadge';

export default withLocalize(MarkerBadge);
1 change: 0 additions & 1 deletion src/pages/home/report/ReportActionItemFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class ReportActionItemFragment extends React.PureComponent {

ReportActionItemFragment.propTypes = propTypes;
ReportActionItemFragment.defaultProps = defaultProps;
ReportActionItemFragment.displayName = 'ReportActionItemFragment';

export default compose(
withWindowDimensions,
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItemGrouped.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ const ReportActionItemGrouped = ({children}) => (
);

ReportActionItemGrouped.propTypes = propTypes;
ReportActionItemGrouped.displayName = 'ReportActionItemGrouped';
export default ReportActionItemGrouped;
1 change: 0 additions & 1 deletion src/pages/home/report/ReportTypingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class ReportTypingIndicator extends React.Component {

ReportTypingIndicator.propTypes = propTypes;
ReportTypingIndicator.defaultProps = defaultProps;
ReportTypingIndicator.displayName = 'ReportTypingIndicator';

export default compose(
withLocalize,
Expand Down
4 changes: 3 additions & 1 deletion src/pages/iou/IOUBillPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ import React from 'react';
import IOUModal from './IOUModal';

// eslint-disable-next-line react/jsx-props-no-spreading
export default props => <IOUModal {...props} hasMultipleParticipants />;
const IOUBillPage = props => <IOUModal {...props} hasMultipleParticipants />;
IOUBillPage.displayName = 'IOUBillPage';
export default IOUBillPage;
1 change: 0 additions & 1 deletion src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ class IOUCurrencySelection extends Component {

IOUCurrencySelection.propTypes = propTypes;
IOUCurrencySelection.defaultProps = defaultProps;
IOUCurrencySelection.displayName = 'IOUCurrencySelection';

export default compose(
withLocalize,
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ class IOUModal extends Component {

IOUModal.propTypes = propTypes;
IOUModal.defaultProps = defaultProps;
IOUModal.displayName = 'IOUModal';

export default compose(
withLocalize,
Expand Down
4 changes: 3 additions & 1 deletion src/pages/iou/IOURequestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ import React from 'react';
import IOUModal from './IOUModal';

// eslint-disable-next-line react/jsx-props-no-spreading
export default props => <IOUModal {...props} />;
const IOURequestPage = props => <IOUModal {...props} />;
IOURequestPage.displayName = 'IOURequestPage';
export default IOURequestPage;
4 changes: 3 additions & 1 deletion src/pages/iou/IOUSendPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ import CONST from '../../CONST';
import IOUModal from './IOUModal';

// eslint-disable-next-line react/jsx-props-no-spreading
export default props => <IOUModal {...props} iouType={CONST.IOU.IOU_TYPE.SEND} />;
const IOUSendPage = props => <IOUModal {...props} iouType={CONST.IOU.IOU_TYPE.SEND} />;
IOUSendPage.displayName = 'IOUSendPage';
export default IOUSendPage;
1 change: 0 additions & 1 deletion src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class IOUAmountPage extends React.Component {
}
}

IOUAmountPage.displayName = 'IOUAmountPage';
IOUAmountPage.propTypes = propTypes;
IOUAmountPage.defaultProps = defaultProps;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class IOUParticipantsRequest extends Component {
}
}

IOUParticipantsRequest.displayName = 'IOUParticipantsRequest';
IOUParticipantsRequest.propTypes = propTypes;

export default compose(
Expand Down
1 change: 0 additions & 1 deletion src/pages/settings/AddSecondaryLoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ class AddSecondaryLoginPage extends Component {

AddSecondaryLoginPage.propTypes = propTypes;
AddSecondaryLoginPage.defaultProps = defaultProps;
AddSecondaryLoginPage.displayName = 'AddSecondaryLoginPage';

export default compose(
withLocalize,
Expand Down
Loading