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 console error invalid prop in native #20968

Merged
merged 2 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -24,7 +25,7 @@ const getCursorStyle = (isDisabled, isText) => {
return styles.cursorText;
}

return styles.cursorPointer;
return cursor.cursorPointer;
};

const GenericPressable = forwardRef((props, ref) => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyRequestAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}
/>
</>
Expand Down
5 changes: 3 additions & 2 deletions src/components/ReportActionItem/ReportPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -118,12 +119,12 @@ function ReportPreview(props) {
>
<View style={[styles.flexShrink1]}>
{props.iouReport.hasOutstandingIOU ? (
<Text style={[styles.chatItemMessage, styles.cursorPointer, styles.colorMuted]}>
<Text style={[styles.chatItemMessage, cursor.cursorPointer, styles.colorMuted]}>
{lodashGet(message, 'html', props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount}))}
</Text>
) : (
<View style={[styles.flexRow]}>
<Text style={[styles.chatItemMessage, styles.cursorPointer, styles.colorMuted]}>
<Text style={[styles.chatItemMessage, cursor.cursorPointer, styles.colorMuted]}>
{lodashGet(message, 'html', props.translate('iou.payerSettled', {amount: reportAmount}))}
</Text>
{!props.iouReport.hasOutstandingIOU && (
Expand Down
3 changes: 2 additions & 1 deletion src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -354,7 +355,7 @@ class BaseTextInput extends Component {
</Checkbox>
)}
{!this.props.secureTextEntry && Boolean(this.props.icon) && (
<View style={[styles.textInputIconContainer, isEditable ? styles.cursorPointer : styles.pointerEventsNone]}>
<View style={[styles.textInputIconContainer, isEditable ? cursor.cursorPointer : styles.pointerEventsNone]}>
<Icon
src={this.props.icon}
fill={themeColors.icon}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Payments/AddPayPalMePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Text from '../../../components/Text';
import ScreenWrapper from '../../../components/ScreenWrapper';
import Navigation from '../../../libs/Navigation/Navigation';
import styles from '../../../styles/styles';
import cursor from '../../../styles/utilities/cursor';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be directly used in any files. Use styles.cursor.cursorPointer instead. Please make this change everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parasharrajat I update, we should only remove style cursorPointer in styles.js, then styles.cursorPointer will correct for each platform.

import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import Button from '../../../components/Button';
import FixedFooter from '../../../components/FixedFooter';
Expand Down Expand Up @@ -75,7 +76,7 @@ function AddPayPalMePage(props) {
accessibilityLabel={props.translate('addPayPalMePage.supportedCurrencies')}
onPress={() => Linking.openURL('https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies')}
>
<View style={[styles.flexRow, styles.cursorPointer]}>
<View style={[styles.flexRow, cursor.cursorPointer]}>
<TextLink
// eslint-disable-next-line max-len
href="https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies"
Expand Down
4 changes: 0 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2680,10 +2680,6 @@ const styles = {
outline: 'none',
},

cursorPointer: {
cursor: 'pointer',
},

cardStyleNavigator: {
overflow: 'hidden',
height: '100%',
Expand Down