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')} - - -