From b8aeec0bcf2cac06d51129f287f932ba0421ed4e Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 13 Jun 2023 15:07:21 -0700 Subject: [PATCH] Use eslint --fix and prettier to update all function components to use the function keyword --- __mocks__/react-native-safe-area-context.js | 20 +- src/App.js | 48 ++--- src/components/AddPaymentMethodMenu.js | 70 +++---- src/components/AddressSearch/index.js | 4 +- .../BaseAnchorForAttachmentsOnly.js | 4 +- .../AnchorForAttachmentsOnly/index.js | 18 +- .../AnchorForAttachmentsOnly/index.native.js | 16 +- .../BaseAnchorForCommentsOnly.js | 4 +- src/components/AnchorForCommentsOnly/index.js | 22 +- .../AnchorForCommentsOnly/index.native.js | 4 +- src/components/AnimatedStep.js | 4 +- src/components/AnonymousReportFooter.js | 50 ++--- src/components/ArchivedReportFooter.js | 4 +- .../AttachmentCarousel/CarouselActions.js | 4 +- src/components/AttachmentView.js | 4 +- .../BaseAutoCompleteSuggestions.js | 4 +- .../AutoCompleteSuggestions/index.js | 4 +- .../AutoCompleteSuggestions/index.native.js | 7 +- src/components/AutoEmailLink.js | 44 ++-- .../AvatarCropModal/AvatarCropModal.js | 4 +- .../AvatarCropModal/ImageCropView.js | 4 +- src/components/AvatarCropModal/Slider.js | 4 +- src/components/AvatarWithDisplayName.js | 4 +- src/components/AvatarWithIndicator.js | 4 +- src/components/Badge.js | 4 +- src/components/Banner.js | 104 +++++----- src/components/BaseMiniContextMenuItem.js | 42 ++-- src/components/BlockingViews/BlockingView.js | 48 ++--- .../BlockingViews/FullPageNotFoundView.js | 4 +- .../FullPageOfflineBlockingView.js | 4 +- src/components/ButtonWithDropdownMenu.js | 4 +- src/components/CalendarPicker/ArrowIcon.js | 12 +- src/components/CardOverlay.js | 4 +- src/components/CheckboxWithLabel.js | 4 +- src/components/CheckboxWithTooltip/index.js | 4 +- .../CheckboxWithTooltip/index.native.js | 20 +- .../Collapsible/index.native.js | 4 +- src/components/CommunicationsLink.js | 30 +-- src/components/ComposeProviders.js | 24 ++- src/components/ConfirmContent.js | 46 +++-- src/components/ConfirmModal.js | 48 ++--- src/components/ConfirmPopover.js | 42 ++-- src/components/ConfirmationPage.js | 50 ++--- src/components/CopyTextToClipboard.js | 4 +- src/components/CurrentWalletBalance.js | 4 +- src/components/CustomDevMenu/index.native.js | 4 +- .../DeeplinkRedirectLoadingIndicator.js | 50 ++--- src/components/DisplayNames/index.native.js | 20 +- src/components/DotIndicatorMessage.js | 4 +- src/components/DragAndDrop/DropZone/index.js | 22 +- .../EmojiPicker/CategoryShortcutBar.js | 26 +-- .../EmojiPicker/EmojiPickerButton.js | 4 +- src/components/EmojiSuggestions.js | 4 +- src/components/EnvironmentBadge.js | 4 +- src/components/ExpensifyCashLogo.js | 4 +- src/components/ExpensifyWordmark.js | 4 +- src/components/FixedFooter.js | 4 +- src/components/Form.js | 4 +- src/components/FormAlertWithSubmitButton.js | 70 +++---- src/components/FormAlertWrapper.js | 4 +- src/components/FormHelpMessage.js | 4 +- src/components/FullscreenLoadingIndicator.js | 4 +- .../GrowlNotificationContainer/index.js | 21 +- .../index.native.js | 20 +- .../BaseHTMLEngineProvider.js | 4 +- .../HTMLRenderers/AnchorRenderer.js | 4 +- .../HTMLRenderers/CodeRenderer.js | 4 +- .../HTMLRenderers/EditedRenderer.js | 4 +- .../HTMLRenderers/ImageRenderer.js | 4 +- .../HTMLRenderers/MentionHereRenderer.js | 22 +- .../HTMLRenderers/MentionUserRenderer.js | 4 +- .../HTMLRenderers/PreRenderer/index.native.js | 7 +- src/components/HTMLEngineProvider/index.js | 18 +- .../HTMLEngineProvider/index.native.js | 18 +- src/components/Header.js | 56 +++--- src/components/Hoverable/index.native.js | 4 +- src/components/Image/index.native.js | 4 +- src/components/InlineCodeBlock/WrappedText.js | 4 +- src/components/InlineCodeBlock/index.js | 4 +- .../InlineCodeBlock/index.native.js | 4 +- src/components/InlineErrorText.js | 4 +- src/components/InlineSystemMessage.js | 4 +- .../InvertedFlatList/index.android.js | 16 +- src/components/KYCWall/index.js | 16 +- .../KeyboardAvoidingView/index.ios.js | 7 +- src/components/KeyboardAvoidingView/index.js | 4 +- .../index.native.js | 16 +- .../KeyboardSpacer/index.android.js | 16 +- src/components/KeyboardSpacer/index.ios.js | 16 +- src/components/KeyboardSpacer/index.js | 4 +- src/components/LHNOptionsList/OptionRowLHN.js | 4 +- src/components/LocalePicker.js | 4 +- src/components/MentionSuggestions.js | 4 +- src/components/MenuItem.js | 4 +- src/components/MenuItemList.js | 4 +- src/components/MenuItemWithTopDescription.js | 18 +- src/components/Modal/index.android.js | 20 +- src/components/Modal/index.ios.js | 18 +- src/components/Modal/index.web.js | 4 +- src/components/MoneyRequestHeader.js | 4 +- src/components/MultipleAvatars.js | 4 +- src/components/OfflineIndicator.js | 4 +- src/components/OfflineWithFeedback.js | 4 +- src/components/OnyxProvider.js | 12 +- src/components/OpacityView.js | 4 +- src/components/PDFView/PDFInfoMessage.js | 34 ++-- src/components/PinButton.js | 28 +-- src/components/PlaidLink/index.js | 4 +- src/components/PlaidLink/index.native.js | 4 +- src/components/Popover/index.js | 4 +- src/components/Popover/index.native.js | 4 +- src/components/PopoverMenu/index.js | 4 +- .../index.native.js | 4 +- src/components/RNTextInput.js | 28 +-- src/components/RadioButton.js | 40 ++-- src/components/RadioButtonWithLabel.js | 4 +- src/components/Reactions/AddReactionBubble.js | 4 +- .../Reactions/EmojiReactionBubble.js | 32 +-- .../Reactions/MiniQuickEmojiReactions.js | 4 +- .../BaseQuickEmojiReactions.js | 50 ++--- .../Reactions/QuickEmojiReactions/index.js | 4 +- .../QuickEmojiReactions/index.native.js | 4 +- .../Reactions/ReactionTooltipContent.js | 4 +- .../Reactions/ReportActionItemReactions.js | 4 +- .../ReimbursementAccountLoadingIndicator.js | 50 ++--- src/components/RenderHTML.js | 4 +- .../ReportActionItem/ChronosOOOListActions.js | 4 +- src/components/ReportActionItem/IOUPreview.js | 4 +- .../ReportActionItem/MoneyRequestAction.js | 4 +- .../ReportActionItem/RenameAction.js | 4 +- .../ReportActionItem/ReportPreview.js | 4 +- src/components/ReportActionItem/TaskAction.js | 4 +- .../ReportActionItem/TaskPreview.js | 4 +- .../SkeletonViewLines.js | 72 +++---- .../ReportActionsSkeletonView/index.js | 4 +- src/components/ReportHeaderSkeletonView.js | 80 ++++---- src/components/ReportWelcomeText.js | 4 +- src/components/RoomHeaderAvatars.js | 4 +- src/components/SVGImage/index.js | 16 +- src/components/SVGImage/index.native.js | 16 +- src/components/SafeArea/index.ios.js | 18 +- src/components/SafeAreaConsumer.js | 28 +-- src/components/Section.js | 4 +- src/components/SelectCircle.js | 22 +- src/components/SignInPageForm/index.native.js | 4 +- src/components/SplashScreenHider/index.js | 4 +- .../SplashScreenHider/index.native.js | 4 +- src/components/SubscriptAvatar.js | 4 +- src/components/TestToolMenu.js | 102 +++++----- src/components/TestToolRow.js | 16 +- src/components/TestToolsModal.js | 24 ++- src/components/TextLink.js | 4 +- src/components/TextPill.js | 4 +- src/components/TextWithEllipsis/index.js | 30 +-- src/components/UnorderedList.js | 28 +-- src/components/UnreadActionIndicator.js | 24 ++- .../UpdateAppModal/index.desktop.js | 4 +- src/components/UpdateAppModal/index.js | 14 +- .../VideoChatButtonAndMenu/index.android.js | 16 +- .../VideoChatButtonAndMenu/index.js | 16 +- src/components/createOnyxContext.js | 4 +- .../withCurrentUserPersonalDetails.js | 4 +- src/components/withNavigation.js | 4 +- src/components/withNavigationFocus.js | 4 +- src/components/withToggleVisibilityView.js | 22 +- .../Navigation/AppNavigator/PublicScreens.js | 50 ++--- .../ThreePaneView.js | 4 +- src/libs/Navigation/AppNavigator/index.js | 4 +- src/libs/Navigation/NavigationRoot.js | 4 +- src/pages/ConciergePage.js | 4 +- src/pages/EnablePayments/ActivateStep.js | 4 +- src/pages/EnablePayments/FailedKYC.js | 32 +-- .../EnablePayments/TermsPage/LongTermsForm.js | 63 +++--- .../TermsPage/ShortTermsForm.js | 188 +++++++++--------- src/pages/ErrorPage/ErrorBodyText/index.js | 24 ++- src/pages/ErrorPage/GenericErrorPage.js | 116 +++++------ src/pages/ErrorPage/NotFoundPage.js | 18 +- src/pages/GetAssistancePage.js | 4 +- src/pages/LogInWithShortLivedAuthTokenPage.js | 4 +- src/pages/NewGroupPage.js | 16 +- src/pages/ReimbursementAccount/AddressForm.js | 96 ++++----- .../ReimbursementAccount/BankAccountStep.js | 4 +- .../ContinueBankAccountSetup.js | 4 +- .../ReimbursementAccount/Enable2FAPrompt.js | 4 +- src/pages/ReimbursementAccount/EnableStep.js | 4 +- .../ReimbursementAccount/IdentityForm.js | 4 +- src/pages/ReportDetailsPage.js | 4 +- src/pages/ReportParticipantsPage.js | 4 +- src/pages/UnlinkLoginPage.js | 4 +- src/pages/home/HeaderView.js | 4 +- .../MiniReportActionContextMenu/index.js | 26 +-- .../index.android.js | 12 +- .../FloatingMessageCounterContainer/index.js | 18 +- .../report/ReactionList/BaseReactionList.js | 4 +- .../report/ReactionList/HeaderReactionList.js | 20 +- .../home/report/ReportActionItemCreated.js | 4 +- src/pages/home/report/ReportActionItemDate.js | 4 +- .../home/report/ReportActionItemDraft.js | 12 +- .../home/report/ReportActionItemFragment.js | 4 +- .../home/report/ReportActionItemGrouped.js | 12 +- .../home/report/ReportActionItemMessage.js | 46 +++-- .../report/ReportActionItemParentAction.js | 4 +- .../home/report/ReportActionItemSingle.js | 4 +- .../home/report/ReportActionItemThread.js | 4 +- src/pages/home/report/ReportActionsList.js | 4 +- src/pages/home/report/ReportDropUI.js | 32 +-- src/pages/home/sidebar/SidebarScreen/index.js | 4 +- .../sidebar/SidebarScreen/index.native.js | 22 +- src/pages/iou/IOUBillPage.js | 16 +- src/pages/iou/IOURequestPage.js | 4 +- src/pages/iou/IOUSendPage.js | 16 +- src/pages/iou/MoneyRequestModal.js | 4 +- src/pages/iou/SplitBillDetailsPage.js | 4 +- .../iou/steps/MoneyRequestConfirmPage.js | 34 ++-- src/pages/settings/AboutPage/AboutPage.js | 4 +- src/pages/settings/AppDownloadLinks.js | 4 +- src/pages/settings/NewPasswordForm.js | 4 +- .../settings/Payments/AddPayPalMePage.js | 4 +- .../Payments/ChooseTransferAccountPage.js | 4 +- .../settings/Payments/PaymentsPage/index.js | 4 +- .../settings/Preferences/LanguagePage.js | 4 +- .../settings/Preferences/PreferencesPage.js | 4 +- .../settings/Preferences/PriorityModePage.js | 4 +- .../Profile/Contacts/ContactMethodsPage.js | 4 +- .../ValidateCodeForm/index.android.js | 16 +- .../Contacts/ValidateCodeForm/index.js | 16 +- .../PersonalDetails/DateOfBirthPage.js | 4 +- .../PersonalDetailsInitialPage.js | 4 +- src/pages/settings/Profile/ProfilePage.js | 4 +- .../settings/Profile/TimezoneInitialPage.js | 4 +- .../Report/NotificationPreferencePage.js | 4 +- src/pages/settings/Report/RoomNamePage.js | 4 +- .../settings/Report/WriteCapabilityPage.js | 4 +- .../TwoFactorAuthForm/index.android.js | 4 +- .../TwoFactorAuth/TwoFactorAuthForm/index.js | 4 +- src/pages/signin/ChangeExpensifyLoginLink.js | 34 ++-- src/pages/signin/Licenses.js | 40 ++-- src/pages/signin/ResendValidationForm.js | 4 +- src/pages/signin/SignInHeroCopy.js | 30 +-- src/pages/signin/SignInHeroImage.js | 4 +- src/pages/signin/SignInPageHero.js | 34 ++-- src/pages/signin/SignInPageLayout/Footer.js | 4 +- .../SignInPageLayout/SignInPageContent.js | 90 +++++---- .../SignInPageLayout/SignInPageGraphics.js | 34 ++-- src/pages/signin/SignInPageLayout/index.js | 4 +- src/pages/signin/Socials.js | 48 ++--- src/pages/signin/Terms.js | 44 ++-- src/pages/signin/UnlinkLoginForm.js | 4 +- .../signin/ValidateCodeForm/index.android.js | 14 +- src/pages/signin/ValidateCodeForm/index.js | 14 +- src/pages/tasks/NewTaskDescriptionPage.js | 4 +- src/pages/tasks/NewTaskDetailsPage.js | 4 +- src/pages/tasks/NewTaskPage.js | 4 +- src/pages/tasks/NewTaskTitlePage.js | 4 +- src/pages/tasks/TaskAssigneeSelectorModal.js | 4 +- .../TaskShareDestinationSelectorModal.js | 4 +- src/pages/workspace/WorkspaceInitialPage.js | 4 +- .../WorkspaceResetBankAccountModal.js | 4 +- .../bills/WorkspaceBillsFirstSection.js | 4 +- .../bills/WorkspaceBillsNoVBAView.js | 50 ++--- .../workspace/bills/WorkspaceBillsPage.js | 32 +-- .../workspace/bills/WorkspaceBillsVBAView.js | 4 +- .../workspace/card/WorkspaceCardNoVBAView.js | 58 +++--- src/pages/workspace/card/WorkspaceCardPage.js | 34 ++-- .../card/WorkspaceCardVBANoECardView.js | 64 +++--- .../card/WorkspaceCardVBAWithECardView.js | 4 +- .../invoices/WorkspaceInvoicesFirstSection.js | 4 +- .../invoices/WorkspaceInvoicesNoVBAView.js | 50 ++--- .../invoices/WorkspaceInvoicesPage.js | 32 +-- .../invoices/WorkspaceInvoicesVBAView.js | 4 +- .../reimburse/WorkspaceReimbursePage.js | 24 ++- .../travel/WorkspaceTravelNoVBAView.js | 46 +++-- .../workspace/travel/WorkspaceTravelPage.js | 32 +-- .../travel/WorkspaceTravelVBAView.js | 78 ++++---- src/pages/workspace/withPolicy.js | 4 +- .../withPolicyAndFullscreenLoading.js | 4 +- src/stories/AddressSearch.stories.js | 4 +- src/stories/Banner.stories.js | 4 +- src/stories/Button.stories.js | 8 +- src/stories/ButtonWithDropdownMenu.stories.js | 4 +- src/stories/Checkbox.stories.js | 4 +- src/stories/CheckboxWithLabel.stories.js | 4 +- src/stories/Composer.stories.js | 4 +- src/stories/Datepicker.stories.js | 4 +- src/stories/DragAndDrop.stories.js | 4 +- src/stories/Form.stories.js | 8 +- .../FormAlertWithSubmitButton.stories.js | 4 +- src/stories/Header.stories.js | 4 +- src/stories/HeaderWithBackButton.stories.js | 4 +- src/stories/InlineSystemMessage.stories.js | 4 +- src/stories/MagicCodeInput.stories.js | 4 +- src/stories/MenuItem.stories.js | 4 +- src/stories/OptionRow.stories.js | 12 +- src/stories/Picker.stories.js | 4 +- src/stories/PopoverMenu.stories.js | 4 +- src/stories/SubscriptAvatar.stories.js | 4 +- src/stories/TextInput.stories.js | 8 +- src/stories/Tooltip.stories.js | 54 ++--- tests/unit/CalendarPickerTest.js | 4 +- 299 files changed, 2476 insertions(+), 2205 deletions(-) diff --git a/__mocks__/react-native-safe-area-context.js b/__mocks__/react-native-safe-area-context.js index f17c34cf326e..4b4af7841c2c 100644 --- a/__mocks__/react-native-safe-area-context.js +++ b/__mocks__/react-native-safe-area-context.js @@ -9,15 +9,17 @@ const insets = { }; function withSafeAreaInsets(WrappedComponent) { - const WithSafeAreaInsets = (props) => ( - - ); + function WithSafeAreaInsets(props) { + return ( + + ); + } return forwardRef((props, ref) => ( ( - - - - - - - - -); +function App() { + return ( + + + + + + + + + ); +} App.displayName = 'App'; diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 2581bde85b4e..e5f6bf946f16 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -43,41 +43,43 @@ const defaultProps = { betas: [], }; -const AddPaymentMethodMenu = (props) => ( - { - props.onItemSelected(CONST.PAYMENT_METHODS.BANK_ACCOUNT); +function AddPaymentMethodMenu(props) { + return ( + { + props.onItemSelected(CONST.PAYMENT_METHODS.BANK_ACCOUNT); + }, }, - }, - ...(Permissions.canUseWallet(props.betas) - ? [ - { - text: props.translate('common.debitCard'), - icon: Expensicons.CreditCard, - onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), - }, - ] - : []), - ...(props.shouldShowPaypal && !props.payPalMeData.description - ? [ - { - text: props.translate('common.payPalMe'), - icon: Expensicons.PayPal, - onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.PAYPAL), - }, - ] - : []), - ]} - /> -); + ...(Permissions.canUseWallet(props.betas) + ? [ + { + text: props.translate('common.debitCard'), + icon: Expensicons.CreditCard, + onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), + }, + ] + : []), + ...(props.shouldShowPaypal && !props.payPalMeData.description + ? [ + { + text: props.translate('common.payPalMe'), + icon: Expensicons.PayPal, + onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.PAYPAL), + }, + ] + : []), + ]} + /> + ); +} AddPaymentMethodMenu.propTypes = propTypes; AddPaymentMethodMenu.defaultProps = defaultProps; diff --git a/src/components/AddressSearch/index.js b/src/components/AddressSearch/index.js index 5219c5b4855f..9699eb9aab94 100644 --- a/src/components/AddressSearch/index.js +++ b/src/components/AddressSearch/index.js @@ -91,7 +91,7 @@ const defaultProps = { // Do not convert to class component! It's been tried before and presents more challenges than it's worth. // Relevant thread: https://expensify.slack.com/archives/C03TQ48KC/p1634088400387400 // Reference: https://github.com/FaridSafi/react-native-google-places-autocomplete/issues/609#issuecomment-886133839 -const AddressSearch = (props) => { +function AddressSearch(props) { const [displayListViewBorder, setDisplayListViewBorder] = useState(false); const containerRef = useRef(); const query = useMemo( @@ -291,7 +291,7 @@ const AddressSearch = (props) => { ); -}; +} AddressSearch.propTypes = propTypes; AddressSearch.defaultProps = defaultProps; diff --git a/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js b/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js index 03f293d12f71..f20f798768c2 100644 --- a/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js +++ b/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js @@ -34,7 +34,7 @@ const defaultProps = { ...anchorForAttachmentsOnlyDefaultProps, }; -const BaseAnchorForAttachmentsOnly = (props) => { +function BaseAnchorForAttachmentsOnly(props) { const sourceURL = props.source; const sourceURLWithAuth = addEncryptedAuthTokenToURL(sourceURL); const sourceID = (sourceURL.match(CONST.REGEX.ATTACHMENT_ID) || [])[1]; @@ -70,7 +70,7 @@ const BaseAnchorForAttachmentsOnly = (props) => { )} ); -}; +} BaseAnchorForAttachmentsOnly.displayName = 'BaseAnchorForAttachmentsOnly'; BaseAnchorForAttachmentsOnly.propTypes = propTypes; diff --git a/src/components/AnchorForAttachmentsOnly/index.js b/src/components/AnchorForAttachmentsOnly/index.js index d4d607d3cc65..1a58aa4b3ae1 100644 --- a/src/components/AnchorForAttachmentsOnly/index.js +++ b/src/components/AnchorForAttachmentsOnly/index.js @@ -4,14 +4,16 @@ import BaseAnchorForAttachmentsOnly from './BaseAnchorForAttachmentsOnly'; import * as DeviceCapabilities from '../../libs/DeviceCapabilities'; import ControlSelection from '../../libs/ControlSelection'; -const AnchorForAttachmentsOnly = (props) => ( - DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} - onPressOut={() => ControlSelection.unblock()} - /> -); +function AnchorForAttachmentsOnly(props) { + return ( + DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} + onPressOut={() => ControlSelection.unblock()} + /> + ); +} AnchorForAttachmentsOnly.propTypes = anchorForAttachmentsOnlyPropTypes.propTypes; AnchorForAttachmentsOnly.defaultProps = anchorForAttachmentsOnlyPropTypes.defaultProps; diff --git a/src/components/AnchorForAttachmentsOnly/index.native.js b/src/components/AnchorForAttachmentsOnly/index.native.js index 4fcdd2e6cff3..f27aad641186 100644 --- a/src/components/AnchorForAttachmentsOnly/index.native.js +++ b/src/components/AnchorForAttachmentsOnly/index.native.js @@ -3,13 +3,15 @@ import * as anchorForAttachmentsOnlyPropTypes from './anchorForAttachmentsOnlyPr import BaseAnchorForAttachmentsOnly from './BaseAnchorForAttachmentsOnly'; import styles from '../../styles/styles'; -const AnchorForAttachmentsOnly = (props) => ( - -); +function AnchorForAttachmentsOnly(props) { + return ( + + ); +} AnchorForAttachmentsOnly.propTypes = anchorForAttachmentsOnlyPropTypes.propTypes; AnchorForAttachmentsOnly.defaultProps = anchorForAttachmentsOnlyPropTypes.defaultProps; diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.js index 4a002ef49cf1..191af3613e1f 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.js @@ -38,7 +38,7 @@ const defaultProps = { /* * This is a default anchor component for regular links. */ -const BaseAnchorForCommentsOnly = (props) => { +function BaseAnchorForCommentsOnly(props) { let linkRef; const rest = _.omit(props, _.keys(propTypes)); const linkProps = {}; @@ -85,7 +85,7 @@ const BaseAnchorForCommentsOnly = (props) => { ); -}; +} BaseAnchorForCommentsOnly.propTypes = propTypes; BaseAnchorForCommentsOnly.defaultProps = defaultProps; diff --git a/src/components/AnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/index.js index 1de4ea56b3aa..9ded866b7cdf 100644 --- a/src/components/AnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/index.js @@ -6,16 +6,18 @@ import * as DeviceCapabilities from '../../libs/DeviceCapabilities'; import ControlSelection from '../../libs/ControlSelection'; import styles from '../../styles/styles'; -const AnchorForCommentsOnly = (props) => ( - - DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} - onPressOut={() => ControlSelection.unblock()} - /> - -); +function AnchorForCommentsOnly(props) { + return ( + + DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} + onPressOut={() => ControlSelection.unblock()} + /> + + ); +} AnchorForCommentsOnly.propTypes = anchorForCommentsOnlyPropTypes.propTypes; AnchorForCommentsOnly.defaultProps = anchorForCommentsOnlyPropTypes.defaultProps; diff --git a/src/components/AnchorForCommentsOnly/index.native.js b/src/components/AnchorForCommentsOnly/index.native.js index 21b922f52794..69211b75e855 100644 --- a/src/components/AnchorForCommentsOnly/index.native.js +++ b/src/components/AnchorForCommentsOnly/index.native.js @@ -6,7 +6,7 @@ import * as anchorForCommentsOnlyPropTypes from './anchorForCommentsOnlyPropType import BaseAnchorForCommentsOnly from './BaseAnchorForCommentsOnly'; // eslint-disable-next-line react/jsx-props-no-spreading -const AnchorForCommentsOnly = (props) => { +function AnchorForCommentsOnly(props) { const onPress = () => (_.isFunction(props.onPress) ? props.onPress() : Linking.openURL(props.href)); return ( @@ -16,7 +16,7 @@ const AnchorForCommentsOnly = (props) => { onPress={onPress} /> ); -}; +} AnchorForCommentsOnly.propTypes = anchorForCommentsOnlyPropTypes.propTypes; AnchorForCommentsOnly.defaultProps = anchorForCommentsOnlyPropTypes.defaultProps; diff --git a/src/components/AnimatedStep.js b/src/components/AnimatedStep.js index 0cd7261eb501..dce06cb33760 100644 --- a/src/components/AnimatedStep.js +++ b/src/components/AnimatedStep.js @@ -21,7 +21,7 @@ const defaultProps = { style: [], }; -const AnimatedStep = (props) => { +function AnimatedStep(props) { function getAnimationStyle(direction) { let animationStyle; @@ -43,7 +43,7 @@ const AnimatedStep = (props) => { {props.children} ); -}; +} AnimatedStep.propTypes = propTypes; AnimatedStep.defaultProps = defaultProps; diff --git a/src/components/AnonymousReportFooter.js b/src/components/AnonymousReportFooter.js index 2b92c20d127c..08a4a04e64dd 100644 --- a/src/components/AnonymousReportFooter.js +++ b/src/components/AnonymousReportFooter.js @@ -23,33 +23,35 @@ const defaultProps = { report: {}, }; -const AnonymousReportFooter = (props) => ( - - - - - - - - - - {props.translate('anonymousReportFooter.logoTagline')} - - -