Skip to content

Commit

Permalink
Merge pull request #18153 from robertKozik/fix-opacity-view
Browse files Browse the repository at this point in the history
Fix applying styling when it want to apply opacity on OpacityView
  • Loading branch information
mountiny authored Apr 28, 2023
2 parents 1a04e22 + facb886 commit 5498e38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
9 changes: 5 additions & 4 deletions src/components/OpacityView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import {View} from 'react-native';
import Animated, {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated';
import PropTypes from 'prop-types';
import * as StyleUtils from '../styles/StyleUtils';
Expand Down Expand Up @@ -49,10 +50,10 @@ const OpacityView = (props) => {
}, [props.shouldDim, props.dimmingValue, opacity]);

return (
<Animated.View
style={[opacityStyle, ...StyleUtils.parseStyleAsArray(props.style)]}
>
{props.children}
<Animated.View style={[opacityStyle]}>
<View style={StyleUtils.parseStyleAsArray(props.style)}>
{props.children}
</View>
</Animated.View>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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';
Expand All @@ -23,14 +22,14 @@ import * as StyleUtils from '../../../styles/StyleUtils';
*/
const getCursorStyle = (isDisabled, isText) => {
if (isDisabled) {
return cursor.cursorDisabled;
return styles.cursorDisabled;
}

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

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

const GenericPressable = forwardRef((props, ref) => {
Expand Down
8 changes: 0 additions & 8 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2472,14 +2472,6 @@ const styles = {
outline: 'none',
},

cursorPointer: {
cursor: 'pointer',
},

cursorText: {
cursor: 'text',
},

fullscreenCard: {
position: 'absolute',
left: 0,
Expand Down

0 comments on commit 5498e38

Please sign in to comment.