Skip to content

Commit

Permalink
fix: remove duplicate translations and when view is used in context n…
Browse files Browse the repository at this point in the history
…etwork switching show only the expected content and hide the rest
  • Loading branch information
EtherWizard33 committed Sep 25, 2024
1 parent 94a6cd2 commit e63b9d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
7 changes: 4 additions & 3 deletions app/components/UI/PermissionsSummary/PermissionsSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const PermissionsSummary = ({
isAlreadyConnected = true,
isRenderedAsBottomSheet = true,
isDisconnectAllShown = true,
isNetworkSwitch = false,
}: PermissionsSummaryProps) => {
const { colors } = useTheme();
const { styles } = useStyles(styleSheet, { isRenderedAsBottomSheet });
Expand Down Expand Up @@ -224,7 +225,7 @@ const PermissionsSummary = ({
</View>
</View>
</View>
{renderEndAccessory()}
{!isNetworkSwitch && renderEndAccessory()}
</View>
</TouchableOpacity>
);
Expand All @@ -237,7 +238,7 @@ const PermissionsSummary = ({
{renderHeader()}
<View style={styles.title}>
<TextComponent variant={TextVariant.HeadingSM}>
{!isAlreadyConnected
{!isAlreadyConnected || isNetworkSwitch
? strings('permissions.title_dapp_url_wants_to', {
dappUrl: new URL(currentPageInformation.url).hostname,
})
Expand All @@ -246,7 +247,7 @@ const PermissionsSummary = ({
})}
</TextComponent>
</View>
{renderAccountPermissionsRequestInfoCard()}
{!isNetworkSwitch && renderAccountPermissionsRequestInfoCard()}
{renderNetworkPermissionsRequestInfoCard()}
</View>
<View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export interface PermissionsSummaryProps {
isAlreadyConnected?: boolean;
isRenderedAsBottomSheet?: boolean;
isDisconnectAllShown?: boolean;
isNetworkSwitch?: boolean;
}
1 change: 1 addition & 0 deletions app/components/UI/SwitchCustomNetwork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ const SwitchCustomNetwork = ({
onCancel={onCancel}
onConfirm={onConfirm}
isDisconnectAllShown={false}
isNetworkSwitch
/>
);

Expand Down
11 changes: 0 additions & 11 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1804,17 +1804,6 @@
"edit": "Edit",
"cancel": "Cancel"
},
"permissions": {
"title_this_site_wants_to": "This site wants to:",
"title_dapp_url_wants_to": "{{dappUrl}} wants to:",
"title_dapp_url_has_approval_to": "{{dappUrl}} has approval to:",
"use_enabled_networks": "Use your enabled networks",
"wants_to_see_your_accounts": "See your accounts and suggest transactions",
"requesting_for": "Requesting for ",
"manage_permissions": "Manage Permissions",
"edit": "Edit",
"cancel": "Cancel"
},
"select": {
"cancel": "Cancel",
"done": "Done"
Expand Down

0 comments on commit e63b9d8

Please sign in to comment.