From 2779c11cd934893e36006119f50b2629206ea75c Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Sun, 5 Jan 2025 12:46:51 +0530 Subject: [PATCH] Fix workspace profile page on readOnly mode --- src/components/MenuItem.tsx | 2 +- src/pages/workspace/WorkspaceProfilePage.tsx | 23 +++++--------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 59e7b78feeda..67a137cc82a6 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -612,7 +612,7 @@ function MenuItem( onPressOut={ControlSelection.unblock} onSecondaryInteraction={onSecondaryInteraction} wrapperStyle={outerWrapperStyle} - activeOpacity={variables.pressDimValue} + activeOpacity={!interactive ? 1 : variables.pressDimValue} opacityAnimationDuration={0} testID={pressableTestID} style={({pressed}) => diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index 29f129439f05..ebc7d923d7f2 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -261,11 +261,9 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac titleStyle={styles.workspaceTitleStyle} description={translate('workspace.common.workspaceName')} shouldShowRightIcon={!readOnly} - disabled={readOnly} + interactive={!readOnly} wrapperStyle={[styles.sectionMenuItemTopDescription, shouldUseNarrowLayout ? styles.mt3 : {}]} onPress={onPressName} - shouldGreyOutWhenDisabled={false} - shouldUseDefaultCursorWhenDisabled /> {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( @@ -283,11 +281,9 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac title={policyDescription} description={translate('workspace.editor.descriptionInputLabel')} shouldShowRightIcon={!readOnly} - disabled={readOnly} + interactive={!readOnly} wrapperStyle={styles.sectionMenuItemTopDescription} onPress={onPressDescription} - shouldGreyOutWhenDisabled={false} - shouldUseDefaultCursorWhenDisabled shouldRenderAsHTML /> @@ -307,12 +303,10 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac @@ -324,11 +318,9 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac title={formattedAddress} description={translate('common.companyAddress')} shouldShowRightIcon={!readOnly} - disabled={readOnly} + interactive={!readOnly} wrapperStyle={styles.sectionMenuItemTopDescription} onPress={onPressAddress} - shouldGreyOutWhenDisabled={false} - shouldUseDefaultCursorWhenDisabled /> @@ -340,12 +332,9 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac