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

Fix workspace profile page on readOnly mode #54803

Merged
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/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}) =>
Expand Down
23 changes: 6 additions & 17 deletions src/pages/workspace/WorkspaceProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
</OfflineWithFeedback>
{(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && (
Expand All @@ -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
/>
</OfflineWithFeedback>
Expand All @@ -307,12 +303,10 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac
<MenuItemWithTopDescription
title={formattedCurrency}
description={translate('workspace.editor.currencyInputLabel')}
shouldShowRightIcon={!readOnly}
disabled={hasVBA ? true : readOnly}
shouldShowRightIcon={hasVBA ? false : !readOnly}
interactive={hasVBA ? false : !readOnly}
wrapperStyle={styles.sectionMenuItemTopDescription}
onPress={onPressCurrency}
shouldGreyOutWhenDisabled={false}
shouldUseDefaultCursorWhenDisabled
hintText={hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')}
/>
</View>
Expand All @@ -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
/>
</View>
</OfflineWithFeedback>
Expand All @@ -340,12 +332,9 @@ function WorkspaceProfilePage({policyDraft, policy: policyProp, route}: Workspac
<MenuItemWithTopDescription
title={PolicyUtils.getUserFriendlyWorkspaceType(policy.type)}
description={translate('workspace.common.planType')}
shouldShowRightIcon={!readOnly}
disabled={readOnly}
shouldShowRightIcon
wrapperStyle={styles.sectionMenuItemTopDescription}
onPress={onPressPlanType}
shouldGreyOutWhenDisabled={false}
shouldUseDefaultCursorWhenDisabled
/>
</View>
</OfflineWithFeedback>
Expand Down
Loading