Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/components/Pressable/PressableWithFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const PressableWithFeedback = forwardRef((props, ref) => {
...(state.focused ? StyleUtils.parseStyleAsArray(props.focusStyle, state) : []),
]}
>
{props.children}
{_.isFunction(props.children) ? props.children(state) : props.children}
</OpacityView>
)}
</GenericPressable>
Expand Down
11 changes: 8 additions & 3 deletions src/components/Reactions/AddReactionBubble.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useRef} from 'react';
import {Pressable, View} from 'react-native';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import Tooltip from '../Tooltip';
import styles from '../../styles/styles';
Expand All @@ -12,6 +12,7 @@ import * as EmojiPickerAction from '../../libs/actions/EmojiPickerAction';
import variables from '../../styles/variables';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
import * as Session from '../../libs/actions/Session';
import PressableWithFeedback from '../Pressable/PressableWithFeedback';

const propTypes = {
/** Whether it is for context menu so we can modify its style */
Expand Down Expand Up @@ -68,12 +69,16 @@ const AddReactionBubble = (props) => {

return (
<Tooltip text={props.translate('emojiReactions.addReactionTooltip')}>
<Pressable
<PressableWithFeedback
ref={ref}
style={({hovered, pressed}) => [styles.emojiReactionBubble, styles.userSelectNone, StyleUtils.getEmojiReactionBubbleStyle(hovered || pressed, false, props.isContextMenu)]}
onPress={Session.checkIfActionIsAllowed(onPress)}
// Prevent text input blur when Add reaction is clicked
onMouseDown={(e) => e.preventDefault()}
accessibilityLabel={props.translate('emojiReactions.addReactionTooltip')}
accessibilityRole="button"

@luacmartins luacmartins Jun 6, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NAB should we create a CONST for "button"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We're adding the CONSTs here. Let's incorporate those changes in this PR as well.

// disable dimming
pressDimmingValue={1}
>
{({hovered, pressed}) => (
<>
Expand All @@ -91,7 +96,7 @@ const AddReactionBubble = (props) => {
</View>
</>
)}
</Pressable>
</PressableWithFeedback>
</Tooltip>
);
};
Expand Down