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

17033 - migrated HeaderView to PressableWithoutFeedback #19958

Merged
merged 5 commits into from
Jun 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const GenericPressable = forwardRef((props, ref) => {
onKeyPress,
disabled,
style,
accessibilityHint,
shouldUseHapticsOnLongPress,
shouldUseHapticsOnPress,
nextFocusRef,
Expand Down
15 changes: 10 additions & 5 deletions src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'underscore';
import React from 'react';
import {View, Pressable} from 'react-native';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import lodashGet from 'lodash/get';
import {withOnyx} from 'react-native-onyx';
Expand All @@ -27,6 +27,7 @@ import ONYXKEYS from '../../ONYXKEYS';
import ThreeDotsMenu from '../../components/ThreeDotsMenu';
import * as Task from '../../libs/actions/Task';
import reportActionPropTypes from './report/reportActionPropTypes';
import PressableWithoutFeedback from '../../components/Pressable/PressableWithoutFeedback';
import PinButton from '../../components/PinButton';

const propTypes = {
Expand Down Expand Up @@ -126,10 +127,12 @@ const HeaderView = (props) => {
>
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}>
{props.isSmallScreenWidth && (
<Pressable
<PressableWithoutFeedback
onPress={props.onNavigationMenuButtonClicked}
style={[styles.LHNToggle]}
accessibilityHint={props.translate('accessibilityHints.navigateToChatsList')}
accessibilityLabel={props.translate('common.back')}
accessibilityRole="button"
>
<Tooltip
text={props.translate('common.back')}
Expand All @@ -139,14 +142,16 @@ const HeaderView = (props) => {
<Icon src={Expensicons.BackArrow} />
</View>
</Tooltip>
</Pressable>
</PressableWithoutFeedback>
)}
{Boolean(props.report && title) && (
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Pressable
<PressableWithoutFeedback
onPress={() => ReportUtils.navigateToDetailsPage(props.report)}
style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}
disabled={isTaskReport}
accessibilityLabel={title}
accessibilityRole="button"
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB, can we add these roles to CONST.js?

Copy link
Contributor

Choose a reason for hiding this comment

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

That will be done in another PR. I think #20251.
So it makes sense to put this PR on hold a bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I think we can just merge this. From #20251 (comment), it makes sense to replace all of them in one PR as we merged many PRs with hardcoded strings already.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense, thank you

>
{shouldShowSubscript ? (
<SubscriptAvatar
Expand Down Expand Up @@ -187,7 +192,7 @@ const HeaderView = (props) => {
/>
</View>
)}
</Pressable>
</PressableWithoutFeedback>
<View style={[styles.reportOptions, styles.flexRow, styles.alignItemsCenter]}>
{shouldShowCallButton && (
<VideoChatButtonAndMenu
Expand Down