From ade046eebe3da880849ed940ac01d5f5e3bfd86c Mon Sep 17 00:00:00 2001 From: usman-ghani564 Date: Mon, 13 May 2024 21:12:04 +0500 Subject: [PATCH 01/10] add offline feedback for group avatar in report --- .../home/report/ReportActionItemCreated.tsx | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/pages/home/report/ReportActionItemCreated.tsx b/src/pages/home/report/ReportActionItemCreated.tsx index f446c38fb1e9..d2039f636578 100644 --- a/src/pages/home/report/ReportActionItemCreated.tsx +++ b/src/pages/home/report/ReportActionItemCreated.tsx @@ -16,6 +16,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PersonalDetailsList, Policy, Report} from '@src/types/onyx'; import AnimatedEmptyStateBackground from './AnimatedEmptyStateBackground'; +import * as ReportActions from '@userActions/Report'; type ReportActionItemCreatedOnyxProps = { /** The report currently being looked at */ @@ -68,21 +69,25 @@ function ReportActionItemCreated(props: ReportActionItemCreatedProps) { accessibilityLabel={translate('accessibilityHints.chatWelcomeMessage')} style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} > - ReportUtils.navigateToDetailsPage(props.report)} - style={[styles.mh5, styles.mb3, styles.alignSelfStart]} - accessibilityLabel={translate('common.details')} - role={CONST.ROLE.BUTTON} - disabled={shouldDisableDetailPage} + - - + ReportUtils.navigateToDetailsPage(props.report)} + style={[styles.mh5, styles.mb3, styles.alignSelfStart]} + accessibilityLabel={translate('common.details')} + role={CONST.ROLE.BUTTON} + disabled={shouldDisableDetailPage} + > + + + Date: Mon, 13 May 2024 21:12:42 +0500 Subject: [PATCH 02/10] add offline feedback for group avatar in header --- src/pages/home/HeaderView.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx index 935572a1e7dd..e8fe0dabcd72 100644 --- a/src/pages/home/HeaderView.tsx +++ b/src/pages/home/HeaderView.tsx @@ -35,6 +35,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; +import OfflineWithFeedback from '@components/OfflineWithFeedback'; type HeaderViewOnyxProps = { /** URL to the assigned guide's appointment booking calendar */ @@ -266,10 +267,12 @@ function HeaderView({ size={defaultSubscriptSize} /> ) : ( - + + + )} Date: Mon, 13 May 2024 21:13:05 +0500 Subject: [PATCH 03/10] add offline feedback for group avatar in LHN --- .../LHNOptionsList/OptionRowLHN.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index b665c305f5cf..99bd3fc33b14 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -182,17 +182,19 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti size={isInFocusMode ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT} /> ) : ( - + + + ))} From 99e0ed3a8acc77ac4dcb657fdf36f3efd3d37bcb Mon Sep 17 00:00:00 2001 From: usman-ghani564 Date: Mon, 13 May 2024 21:14:16 +0500 Subject: [PATCH 04/10] remove offline feedback from edit icon --- src/components/AvatarWithImagePicker.tsx | 73 ++++++++++++------------ 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/src/components/AvatarWithImagePicker.tsx b/src/components/AvatarWithImagePicker.tsx index 5fa17e726c6f..df6331bcc849 100644 --- a/src/components/AvatarWithImagePicker.tsx +++ b/src/components/AvatarWithImagePicker.tsx @@ -296,32 +296,31 @@ function AvatarWithImagePicker({ return ( - - + - { + if (disabled && enablePreview && onViewPhotoPress) { + onViewPhotoPress(); + return; + } + setIsMenuVisible((prev) => !prev); + }} + accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON} + accessibilityLabel={translate('avatarWithImagePicker.editImage')} + disabled={isAvatarCropModalOpen || (disabled && !enablePreview)} + disabledStyle={disabledStyle} + style={[styles.pRelative, avatarStyle]} + ref={anchorRef} > - { - if (disabled && enablePreview && onViewPhotoPress) { - onViewPhotoPress(); - return; - } - setIsMenuVisible((prev) => !prev); - }} - accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON} - accessibilityLabel={translate('avatarWithImagePicker.editImage')} - disabled={isAvatarCropModalOpen || (disabled && !enablePreview)} - disabledStyle={disabledStyle} - style={[styles.pRelative, avatarStyle]} - ref={anchorRef} + {source ? ( @@ -337,19 +336,19 @@ function AvatarWithImagePicker({ )} - {!disabled && ( - - - - )} - - - + + {!disabled && ( + + + + )} + + Date: Mon, 13 May 2024 21:15:18 +0500 Subject: [PATCH 05/10] remove offline feedback from avatar edit icon in profile setting page --- src/pages/settings/InitialSettingsPage.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 2dfeb1841a74..f0b0670aa5b2 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -407,10 +407,7 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa - + - + Date: Tue, 14 May 2024 00:13:17 +0500 Subject: [PATCH 06/10] revert offline feedback for avatar in LHN --- .../LHNOptionsList/OptionRowLHN.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index 99bd3fc33b14..b665c305f5cf 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -182,19 +182,17 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti size={isInFocusMode ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT} /> ) : ( - - - + ))} From ce676eb52f7fea2d6b5d75b7584e1a0f57427031 Mon Sep 17 00:00:00 2001 From: usman-ghani564 Date: Tue, 14 May 2024 00:16:18 +0500 Subject: [PATCH 07/10] fix lint --- src/pages/home/HeaderView.tsx | 2 +- src/pages/home/report/ReportActionItemCreated.tsx | 5 +---- src/pages/settings/InitialSettingsPage.tsx | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx index e8fe0dabcd72..cc3c8dccd0e1 100644 --- a/src/pages/home/HeaderView.tsx +++ b/src/pages/home/HeaderView.tsx @@ -9,6 +9,7 @@ import type {ThreeDotsMenuItem} from '@components/HeaderWithBackButton/types'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import MultipleAvatars from '@components/MultipleAvatars'; +import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ParentNavigationSubtitle from '@components/ParentNavigationSubtitle'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; import ReportHeaderSkeletonView from '@components/ReportHeaderSkeletonView'; @@ -35,7 +36,6 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; -import OfflineWithFeedback from '@components/OfflineWithFeedback'; type HeaderViewOnyxProps = { /** URL to the assigned guide's appointment booking calendar */ diff --git a/src/pages/home/report/ReportActionItemCreated.tsx b/src/pages/home/report/ReportActionItemCreated.tsx index d2039f636578..d098716c2007 100644 --- a/src/pages/home/report/ReportActionItemCreated.tsx +++ b/src/pages/home/report/ReportActionItemCreated.tsx @@ -16,7 +16,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PersonalDetailsList, Policy, Report} from '@src/types/onyx'; import AnimatedEmptyStateBackground from './AnimatedEmptyStateBackground'; -import * as ReportActions from '@userActions/Report'; type ReportActionItemCreatedOnyxProps = { /** The report currently being looked at */ @@ -69,9 +68,7 @@ function ReportActionItemCreated(props: ReportActionItemCreatedProps) { accessibilityLabel={translate('accessibilityHints.chatWelcomeMessage')} style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} > - + ReportUtils.navigateToDetailsPage(props.report)} style={[styles.mh5, styles.mb3, styles.alignSelfStart]} diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index f0b0670aa5b2..5c2c30689c85 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -12,7 +12,6 @@ import CurrentUserPersonalDetailsSkeletonView from '@components/CurrentUserPerso import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import MenuItem from '@components/MenuItem'; -import OfflineWithFeedback from '@components/OfflineWithFeedback'; import {PressableWithFeedback} from '@components/Pressable'; import ScreenWrapper from '@components/ScreenWrapper'; import {ScrollOffsetContext} from '@components/ScrollOffsetContextProvider'; From c218f42a8533a84c2ae57f8fb80507f2a506f564 Mon Sep 17 00:00:00 2001 From: usman-ghani564 Date: Tue, 14 May 2024 19:21:09 +0500 Subject: [PATCH 08/10] fix error message style --- src/components/AvatarWithImagePicker.tsx | 102 ++++++++++++----------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/src/components/AvatarWithImagePicker.tsx b/src/components/AvatarWithImagePicker.tsx index df6331bcc849..45cb203e2e58 100644 --- a/src/components/AvatarWithImagePicker.tsx +++ b/src/components/AvatarWithImagePicker.tsx @@ -296,59 +296,63 @@ function AvatarWithImagePicker({ return ( - - + - { - if (disabled && enablePreview && onViewPhotoPress) { - onViewPhotoPress(); - return; - } - setIsMenuVisible((prev) => !prev); - }} - accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON} - accessibilityLabel={translate('avatarWithImagePicker.editImage')} - disabled={isAvatarCropModalOpen || (disabled && !enablePreview)} - disabledStyle={disabledStyle} - style={[styles.pRelative, avatarStyle]} - ref={anchorRef} + - { + if (disabled && enablePreview && onViewPhotoPress) { + onViewPhotoPress(); + return; + } + setIsMenuVisible((prev) => !prev); + }} + accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON} + accessibilityLabel={translate('avatarWithImagePicker.editImage')} + disabled={isAvatarCropModalOpen || (disabled && !enablePreview)} + disabledStyle={disabledStyle} + style={[styles.pRelative, avatarStyle]} + ref={anchorRef} > - - {source ? ( - + + {source ? ( + + ) : ( + + )} + + + {!disabled && ( + + - ) : ( - - )} - - - {!disabled && ( - - - - )} - - + + )} + + + Date: Tue, 14 May 2024 19:21:52 +0500 Subject: [PATCH 09/10] fix lint --- src/components/AvatarWithImagePicker.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/AvatarWithImagePicker.tsx b/src/components/AvatarWithImagePicker.tsx index 45cb203e2e58..a37c707e068b 100644 --- a/src/components/AvatarWithImagePicker.tsx +++ b/src/components/AvatarWithImagePicker.tsx @@ -322,9 +322,7 @@ function AvatarWithImagePicker({ style={[styles.pRelative, avatarStyle]} ref={anchorRef} > - + {source ? ( Date: Fri, 24 May 2024 03:34:50 +0500 Subject: [PATCH 10/10] remove extra view --- src/components/AvatarWithImagePicker.tsx | 26 +++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/components/AvatarWithImagePicker.tsx b/src/components/AvatarWithImagePicker.tsx index a37c707e068b..189765d20966 100644 --- a/src/components/AvatarWithImagePicker.tsx +++ b/src/components/AvatarWithImagePicker.tsx @@ -323,20 +323,18 @@ function AvatarWithImagePicker({ ref={anchorRef} > - - {source ? ( - - ) : ( - - )} - + {source ? ( + + ) : ( + + )} {!disabled && (