From 6a894412d2b21dc2e1353a41444bfe1eb94eeb56 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Sat, 17 Jun 2023 23:50:57 +0700 Subject: [PATCH 1/2] Fix console error invalid prop in native --- .../Pressable/GenericPressable/BaseGenericPressable.js | 3 ++- src/components/ReportActionItem/MoneyRequestAction.js | 3 ++- src/components/ReportActionItem/ReportPreview.js | 5 +++-- src/components/TextInput/BaseTextInput.js | 3 ++- src/pages/settings/Payments/AddPayPalMePage.js | 3 ++- src/styles/styles.js | 4 ---- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/Pressable/GenericPressable/BaseGenericPressable.js b/src/components/Pressable/GenericPressable/BaseGenericPressable.js index 066e14989930..44fdca70aded 100644 --- a/src/components/Pressable/GenericPressable/BaseGenericPressable.js +++ b/src/components/Pressable/GenericPressable/BaseGenericPressable.js @@ -5,6 +5,7 @@ import Accessibility from '../../../libs/Accessibility'; import HapticFeedback from '../../../libs/HapticFeedback'; import KeyboardShortcut from '../../../libs/KeyboardShortcut'; import styles from '../../../styles/styles'; +import cursor from '../../../styles/utilities/cursor'; import genericPressablePropTypes from './PropTypes'; import CONST from '../../../CONST'; import * as StyleUtils from '../../../styles/StyleUtils'; @@ -24,7 +25,7 @@ const getCursorStyle = (isDisabled, isText) => { return styles.cursorText; } - return styles.cursorPointer; + return cursor.cursorPointer; }; const GenericPressable = forwardRef((props, ref) => { diff --git a/src/components/ReportActionItem/MoneyRequestAction.js b/src/components/ReportActionItem/MoneyRequestAction.js index 8bef184bab08..50c88401721b 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.js +++ b/src/components/ReportActionItem/MoneyRequestAction.js @@ -14,6 +14,7 @@ import IOUPreview from './IOUPreview'; import Navigation from '../../libs/Navigation/Navigation'; import ROUTES from '../../ROUTES'; import styles from '../../styles/styles'; +import cursor from '../../styles/utilities/cursor'; import * as IOUUtils from '../../libs/IOUUtils'; import * as ReportUtils from '../../libs/ReportUtils'; import * as Report from '../../libs/actions/Report'; @@ -154,7 +155,7 @@ function MoneyRequestAction(props) { checkIfContextMenuActive={props.checkIfContextMenuActive} shouldShowPendingConversionMessage={shouldShowPendingConversionMessage} onPreviewPressed={onIOUPreviewPressed} - containerStyles={[styles.cursorPointer, props.isHovered ? styles.iouPreviewBoxHover : undefined, ...props.style]} + containerStyles={[cursor.cursorPointer, props.isHovered ? styles.iouPreviewBoxHover : undefined, ...props.style]} isHovered={props.isHovered} /> diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index 7fa9ebcd6745..b73b10f67442 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -8,6 +8,7 @@ import Text from '../Text'; import Icon from '../Icon'; import * as Expensicons from '../Icon/Expensicons'; import styles from '../../styles/styles'; +import cursor from '../../styles/utilities/cursor'; import reportActionPropTypes from '../../pages/home/report/reportActionPropTypes'; import withLocalize, {withLocalizePropTypes} from '../withLocalize'; import compose from '../../libs/compose'; @@ -118,12 +119,12 @@ function ReportPreview(props) { > {props.iouReport.hasOutstandingIOU ? ( - + {lodashGet(message, 'html', props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount}))} ) : ( - + {lodashGet(message, 'html', props.translate('iou.payerSettled', {amount: reportAmount}))} {!props.iouReport.hasOutstandingIOU && ( diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js index 91ab2162674f..00fb9761dc1e 100644 --- a/src/components/TextInput/BaseTextInput.js +++ b/src/components/TextInput/BaseTextInput.js @@ -7,6 +7,7 @@ import TextInputLabel from './TextInputLabel'; import * as baseTextInputPropTypes from './baseTextInputPropTypes'; import themeColors from '../../styles/themes/default'; import styles from '../../styles/styles'; +import cursor from '../../styles/utilities/cursor'; import Icon from '../Icon'; import * as Expensicons from '../Icon/Expensicons'; import Text from '../Text'; @@ -354,7 +355,7 @@ class BaseTextInput extends Component { )} {!this.props.secureTextEntry && Boolean(this.props.icon) && ( - + Linking.openURL('https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies')} > - + Date: Mon, 19 Jun 2023 21:57:10 +0700 Subject: [PATCH 2/2] remove import cursor --- .../Pressable/GenericPressable/BaseGenericPressable.js | 3 +-- src/components/ReportActionItem/MoneyRequestAction.js | 3 +-- src/components/ReportActionItem/ReportPreview.js | 5 ++--- src/components/TextInput/BaseTextInput.js | 3 +-- src/pages/settings/Payments/AddPayPalMePage.js | 3 +-- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/Pressable/GenericPressable/BaseGenericPressable.js b/src/components/Pressable/GenericPressable/BaseGenericPressable.js index 44fdca70aded..066e14989930 100644 --- a/src/components/Pressable/GenericPressable/BaseGenericPressable.js +++ b/src/components/Pressable/GenericPressable/BaseGenericPressable.js @@ -5,7 +5,6 @@ import Accessibility from '../../../libs/Accessibility'; import HapticFeedback from '../../../libs/HapticFeedback'; import KeyboardShortcut from '../../../libs/KeyboardShortcut'; import styles from '../../../styles/styles'; -import cursor from '../../../styles/utilities/cursor'; import genericPressablePropTypes from './PropTypes'; import CONST from '../../../CONST'; import * as StyleUtils from '../../../styles/StyleUtils'; @@ -25,7 +24,7 @@ const getCursorStyle = (isDisabled, isText) => { return styles.cursorText; } - return cursor.cursorPointer; + return styles.cursorPointer; }; const GenericPressable = forwardRef((props, ref) => { diff --git a/src/components/ReportActionItem/MoneyRequestAction.js b/src/components/ReportActionItem/MoneyRequestAction.js index 50c88401721b..8bef184bab08 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.js +++ b/src/components/ReportActionItem/MoneyRequestAction.js @@ -14,7 +14,6 @@ import IOUPreview from './IOUPreview'; import Navigation from '../../libs/Navigation/Navigation'; import ROUTES from '../../ROUTES'; import styles from '../../styles/styles'; -import cursor from '../../styles/utilities/cursor'; import * as IOUUtils from '../../libs/IOUUtils'; import * as ReportUtils from '../../libs/ReportUtils'; import * as Report from '../../libs/actions/Report'; @@ -155,7 +154,7 @@ function MoneyRequestAction(props) { checkIfContextMenuActive={props.checkIfContextMenuActive} shouldShowPendingConversionMessage={shouldShowPendingConversionMessage} onPreviewPressed={onIOUPreviewPressed} - containerStyles={[cursor.cursorPointer, props.isHovered ? styles.iouPreviewBoxHover : undefined, ...props.style]} + containerStyles={[styles.cursorPointer, props.isHovered ? styles.iouPreviewBoxHover : undefined, ...props.style]} isHovered={props.isHovered} /> diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index b73b10f67442..7fa9ebcd6745 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -8,7 +8,6 @@ import Text from '../Text'; import Icon from '../Icon'; import * as Expensicons from '../Icon/Expensicons'; import styles from '../../styles/styles'; -import cursor from '../../styles/utilities/cursor'; import reportActionPropTypes from '../../pages/home/report/reportActionPropTypes'; import withLocalize, {withLocalizePropTypes} from '../withLocalize'; import compose from '../../libs/compose'; @@ -119,12 +118,12 @@ function ReportPreview(props) { > {props.iouReport.hasOutstandingIOU ? ( - + {lodashGet(message, 'html', props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount}))} ) : ( - + {lodashGet(message, 'html', props.translate('iou.payerSettled', {amount: reportAmount}))} {!props.iouReport.hasOutstandingIOU && ( diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js index 00fb9761dc1e..91ab2162674f 100644 --- a/src/components/TextInput/BaseTextInput.js +++ b/src/components/TextInput/BaseTextInput.js @@ -7,7 +7,6 @@ import TextInputLabel from './TextInputLabel'; import * as baseTextInputPropTypes from './baseTextInputPropTypes'; import themeColors from '../../styles/themes/default'; import styles from '../../styles/styles'; -import cursor from '../../styles/utilities/cursor'; import Icon from '../Icon'; import * as Expensicons from '../Icon/Expensicons'; import Text from '../Text'; @@ -355,7 +354,7 @@ class BaseTextInput extends Component { )} {!this.props.secureTextEntry && Boolean(this.props.icon) && ( - + Linking.openURL('https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies')} > - +