ADD: Provide explanation for disabled feature

This commit is contained in:
Marcos Rodriguez Velez 2024-05-17 08:52:17 -04:00
parent 887e655e96
commit d7d45a8a66
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
2 changed files with 24 additions and 21 deletions

View file

@ -277,6 +277,7 @@
"encrypt_title": "Security", "encrypt_title": "Security",
"encrypt_tstorage": "Storage", "encrypt_tstorage": "Storage",
"encrypt_use": "Use {type}", "encrypt_use": "Use {type}",
"encrypted_feature_disabled": "This feature cannot be used with encrypted storage enabled.",
"encrypt_use_expl": "{type} will be used to confirm your identity before making a transaction, unlocking, exporting, or deleting a wallet. {type} will not be used to unlock encrypted storage.", "encrypt_use_expl": "{type} will be used to confirm your identity before making a transaction, unlocking, exporting, or deleting a wallet. {type} will not be used to unlock encrypted storage.",
"biometrics_fail": "If {type} is not enabled, or fails to unlock, you can use your device passcode as an alternative.", "biometrics_fail": "If {type} is not enabled, or fails to unlock, you can use your device passcode as an alternative.",
"general": "General", "general": "General",

View file

@ -123,24 +123,24 @@ const SettingsPrivacy: React.FC = () => {
</Pressable> </Pressable>
</BlueCard> </BlueCard>
<BlueSpacing20 /> <BlueSpacing20 />
{!storageIsEncrypted && ( <ListItem
<> hideChevron
<ListItem title={loc.settings.privacy_quickactions}
hideChevron Component={TouchableWithoutFeedback}
title={loc.settings.privacy_quickactions} switch={{
Component={TouchableWithoutFeedback} onValueChange: onQuickActionsValueChange,
switch={{ value: storageIsEncrypted ? false : isQuickActionsEnabled,
onValueChange: onQuickActionsValueChange, disabled: isLoading === SettingsPrivacySection.All || storageIsEncrypted,
value: isQuickActionsEnabled, testID: 'QuickActionsSwitch',
disabled: isLoading === SettingsPrivacySection.All, }}
testID: 'QuickActionsSwitch', />
}} {}
/> <BlueCard>
<BlueCard> <BlueText>{loc.settings.privacy_quickactions_explanation}</BlueText>
<BlueText>{loc.settings.privacy_quickactions_explanation}</BlueText> <BlueSpacing20 />
</BlueCard> {storageIsEncrypted && <BlueText>{loc.settings.encrypted_feature_disabled}</BlueText>}
</> </BlueCard>
)}
<ListItem <ListItem
hideChevron hideChevron
title={loc.settings.privacy_do_not_track} title={loc.settings.privacy_do_not_track}
@ -150,7 +150,7 @@ const SettingsPrivacy: React.FC = () => {
<BlueCard> <BlueCard>
<BlueText>{loc.settings.privacy_do_not_track_explanation}</BlueText> <BlueText>{loc.settings.privacy_do_not_track_explanation}</BlueText>
</BlueCard> </BlueCard>
{Platform.OS === 'ios' && !storageIsEncrypted && ( {Platform.OS === 'ios' && (
<> <>
<BlueSpacing40 /> <BlueSpacing40 />
<Text adjustsFontSizeToFit style={[styles.widgetsHeader, styleHooks.widgetsHeader]}> <Text adjustsFontSizeToFit style={[styles.widgetsHeader, styleHooks.widgetsHeader]}>
@ -162,12 +162,14 @@ const SettingsPrivacy: React.FC = () => {
Component={TouchableWithoutFeedback} Component={TouchableWithoutFeedback}
switch={{ switch={{
onValueChange: onWidgetsTotalBalanceValueChange, onValueChange: onWidgetsTotalBalanceValueChange,
value: isWidgetBalanceDisplayAllowed, value: storageIsEncrypted ? false : isWidgetBalanceDisplayAllowed,
disabled: isLoading === SettingsPrivacySection.All, disabled: isLoading === SettingsPrivacySection.All || storageIsEncrypted,
}} }}
/> />
<BlueCard> <BlueCard>
<BlueText>{loc.settings.total_balance_explanation}</BlueText> <BlueText>{loc.settings.total_balance_explanation}</BlueText>
<BlueSpacing20 />
{storageIsEncrypted && <BlueText>{loc.settings.encrypted_feature_disabled}</BlueText>}
</BlueCard> </BlueCard>
</> </>
)} )}