Skip to content

Commit

Permalink
use platform specific cursor utility in BaseGenericPressable
Browse files Browse the repository at this point in the history
  • Loading branch information
robertKozik committed Apr 27, 2023
1 parent 2006a89 commit 27ba2fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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 @@ -22,14 +23,14 @@ import * as StyleUtils from '../../../styles/StyleUtils';
*/
const getCursorStyle = (isDisabled, isText) => {
if (isDisabled) {
return styles.cursorDisabled;
return cursor.cursorDisabled;
}

if (isText) {
return styles.cursorText;
return cursor.cursorText;
}

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

const GenericPressable = forwardRef((props, ref) => {
Expand Down
3 changes: 3 additions & 0 deletions src/styles/utilities/cursor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ export default {
cursorInitial: {
cursor: 'initial',
},
cursorText: {
cursor: 'text',
},
};
1 change: 1 addition & 0 deletions src/styles/utilities/cursor/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default {
cursorGrabbing: {},
cursorZoomOut: {},
cursorInitial: {},
cursorText: {},
};

0 comments on commit 27ba2fa

Please sign in to comment.