Skip to content
Draft
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
11 changes: 6 additions & 5 deletions src/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2946,7 +2946,8 @@
"cloud_backup_link": "Learn more…",
"view_secret_phrase": "View Secret Phrase",
"view_private_key": "View Private Key",
"copy_wallet_address": "Copy wallet address"
"copy_wallet_address": "Copy Address",
"edit_smart_wallet": "Edit Smart Wallet"
},
"delegations": {
"active": "Active",
Expand All @@ -2959,11 +2960,11 @@
"disable_title": "Disable Smart Wallet",
"disable_subtitle": "This will revoke all active delegations and disable Smart Wallet features.",
"disable_button": "Hold to Disable",
"revoke_network_title": "Revoke %{network}",
"revoke_network_subtitle": "This will remove the delegation for this network.",
"revoke_network_title": "Disable on %{network}",
"revoke_network_subtitle": "This will remove the Smart Wallet delegation for this network.",
"revoke_network_button": "Hold to Revoke",
"conflict_title": "Smart Wallet Conflict",
"conflict_subtitle": "Your wallet is delegated to a different provider's Smart Wallet. Disable this to use Rainbow instead.",
"conflict_title": "Disable Account",
"conflict_subtitle": "Your wallet is delegated to a different Smart Wallet. Disable to use Rainbow.",
"conflict_button": "Hold to Disable",
"security_title": "Security Alert",
"security_subtitle": "An unknown delegation was detected. Revoke it to secure your wallet.",
Expand Down
1 change: 1 addition & 0 deletions src/navigation/routesNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const Routes = {
VIEW_CLOUD_BACKUPS: 'ViewCloudBackups',
SECRET_WARNING: 'SecretWarning',
SHOW_SECRET: 'ShowSecret',
VIEW_WALLET_DELEGATIONS: 'ViewWalletDelegations',
DAPP_BROWSER_CONTROL_PANEL: 'DappBrowserControlPanel',
NETWORK_SELECTOR: 'NetworkSelector',
CLAIM_REWARDS_PANEL: 'ClaimRewardsPanel',
Expand Down
6 changes: 6 additions & 0 deletions src/navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,12 @@ type RouteParams = {
walletId: string;
};

[Routes.VIEW_WALLET_DELEGATIONS]: {
walletId: string;
address: Address;
title: string;
};

[Routes.RESTORE_SHEET]: {
fromSettings?: boolean;
};
Expand Down
9 changes: 9 additions & 0 deletions src/screens/SettingsSheet/SettingsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import SettingsSection from './components/SettingsSection';
import WalletNotificationsSettings from './components/WalletNotificationsSettings';
import { settingsOptions } from '@/navigation/config';
import ViewCloudBackups from './components/Backups/ViewCloudBackups';
import ViewWalletDelegations from './components/Backups/ViewWalletDelegations';
import { SimpleSheet } from '@/components/sheet/SimpleSheet';
import Routes from '@/navigation/routesNames';
import { useAccountSettings } from '@/hooks';
Expand Down Expand Up @@ -108,6 +109,14 @@ export function SettingsSheet() {
title: route.params?.title,
})}
/>
<Stack.Screen
component={ViewWalletDelegations}
name={Routes.VIEW_WALLET_DELEGATIONS}
options={({ route }: any) => ({
cardStyleInterpolator: settingsCardStyleInterpolator,
title: route.params?.title,
})}
/>
<Stack.Screen
component={SecretWarning}
name={Routes.SECRET_WARNING}
Expand Down
25 changes: 25 additions & 0 deletions src/screens/SettingsSheet/components/Backups/ViewWalletBackup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ import MenuContainer from '../MenuContainer';
import MenuHeader from '../MenuHeader';
import MenuItem from '../MenuItem';
import { BackUpMenuItem } from './BackUpMenuButton';
import type { Address } from 'viem';

type ViewWalletBackupParams = {
ViewWalletBackup: { walletId: string; title: string; imported?: boolean };
};

const enum WalletMenuAction {
EditSmartWallet = 'edit_smart_wallet',
ViewPrivateKey = 'view_private_key',
CopyWalletAddress = 'copy_wallet_address',
}
Expand Down Expand Up @@ -236,6 +238,14 @@ const ViewWalletBackup = () => {
const menuConfig = {
menuTitle: '',
menuItems: [
{
actionKey: WalletMenuAction.EditSmartWallet,
actionTitle: i18n.t(i18n.l.wallet.back_ups.edit_smart_wallet),
icon: {
iconType: 'SYSTEM',
iconValue: 'gearshape',
},
},
{
actionKey: WalletMenuAction.ViewPrivateKey,
actionTitle: i18n.t(i18n.l.wallet.back_ups.view_private_key),
Expand All @@ -257,6 +267,21 @@ const ViewWalletBackup = () => {

const onPressMenuItem = ({ nativeEvent: { actionKey: menuAction }, account }: MenuEvent) => {
switch (menuAction) {
case WalletMenuAction.EditSmartWallet: {
const title =
formatAccountLabel({
address: account.address,
ens: abbreviations.abbreviateEnsForDisplay(account.ens ?? undefined, 8, 4),
label: account.label,
}) || abbreviations.address(account.address, 6, 4);

navigate(Routes.VIEW_WALLET_DELEGATIONS, {
walletId,
address: account.address as Address,
title: title ?? '',
});
break;
}
case WalletMenuAction.ViewPrivateKey: {
const title =
formatAccountLabel({
Expand Down
Loading
Loading