-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: add close icon to header for concierge chat in desktop #78955
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,7 @@ import { | |||||
| isChatRoom as isChatRoomReportUtils, | ||||||
| isChatThread as isChatThreadReportUtils, | ||||||
| isChatUsedForOnboarding as isChatUsedForOnboardingReportUtils, | ||||||
| isConciergeChatReport, | ||||||
| isCurrentUserSubmitter, | ||||||
| isDeprecatedGroupDM, | ||||||
| isExpenseRequest, | ||||||
|
|
@@ -104,7 +105,7 @@ type HeaderViewProps = { | |||||
| }; | ||||||
|
|
||||||
| function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked, shouldUseNarrowLayout = false, isInSidePanel}: HeaderViewProps) { | ||||||
| const icons = useMemoizedLazyExpensifyIcons(['BackArrow']); | ||||||
| const icons = useMemoizedLazyExpensifyIcons(['BackArrow', 'Close']); | ||||||
| // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth | ||||||
| const {isSmallScreenWidth} = useResponsiveLayout(); | ||||||
| const route = useRoute(); | ||||||
|
|
@@ -243,6 +244,10 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked, | |||||
| const hasActiveScheduledCall = latestScheduledCall && !isPast(latestScheduledCall.eventTime) && latestScheduledCall.status !== CONST.SCHEDULE_CALL_STATUS.CANCELLED; | ||||||
| const shouldShowBackButton = shouldUseNarrowLayout || !!isInSidePanel; | ||||||
|
|
||||||
| const shouldShowCloseButton = isInSidePanel && !shouldUseNarrowLayout && isConciergeChatReport(report); | ||||||
| const backButtonIcon = shouldShowCloseButton ? icons.Close : icons.BackArrow; | ||||||
| const backButtonLabel = shouldShowCloseButton ? translate('common.close') : translate('common.back'); | ||||||
|
|
||||||
| const onboardingHelpDropdownButton = ( | ||||||
| <OnboardingHelpDropdownButton | ||||||
| reportID={report?.reportID} | ||||||
|
|
@@ -277,17 +282,17 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked, | |||||
| onPress={onNavigationMenuButtonClicked} | ||||||
| style={[styles.LHNToggle, shouldUseNarrowLayout && styles.pl5]} | ||||||
| accessibilityHint={translate('accessibilityHints.navigateToChatsList')} | ||||||
| accessibilityLabel={translate('common.back')} | ||||||
| accessibilityLabel={backButtonLabel} | ||||||
| role={CONST.ROLE.BUTTON} | ||||||
| sentryLabel={CONST.SENTRY_LABEL.HEADER_VIEW.BACK_BUTTON} | ||||||
|
||||||
| sentryLabel={CONST.SENTRY_LABEL.HEADER_VIEW.BACK_BUTTON} | |
| sentryLabel={isChatUsedForOnboarding ? 'HEADER_VIEW.CLOSE_BUTTON' : CONST.SENTRY_LABEL.HEADER_VIEW.BACK_BUTTON} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new behavior for showing a close icon for concierge chat in the side panel lacks test coverage. Consider adding a test case that verifies the close icon is displayed when the header is rendered for a concierge chat in a side panel on desktop, and that the back arrow is shown in other scenarios.