Skip to content

Commit 527159f

Browse files
committed
fix: add migration scrippt for network controller v21
1 parent 2bbbe0c commit 527159f

File tree

21 files changed

+2228
-124
lines changed

21 files changed

+2228
-124
lines changed

android/.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,15 @@
1414
<natures>
1515
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
1616
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1727966429894</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
1728
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
arguments=--init-script /var/folders/j9/20w1vr5s10v1y55vbf73rbx40000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/j9/20w1vr5s10v1y55vbf73rbx40000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
15
connection.project.dir=
26
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=/Users/salim/Library/Java/JavaVirtualMachines/azul-16.0.2/Contents/Home
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true

app/actions/security/index.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export enum ActionType {
88
SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN = 'SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN',
99
SET_DATA_COLLECTION_FOR_MARKETING = 'SET_DATA_COLLECTION_FOR_MARKETING',
1010
SET_NFT_AUTO_DETECTION_MODAL_OPEN = 'SET_NFT_AUTO_DETECTION_MODAL_OPEN',
11+
SET_MULTI_RPC_MIGRATION_MODAL_OPEN = 'SET_MULTI_RPC_MIGRATION_MODAL_OPEN',
1112
}
1213

1314
export interface AllowLoginWithRememberMeUpdated
@@ -35,6 +36,11 @@ export interface SetNftAutoDetectionModalOpen
3536
open: boolean;
3637
}
3738

39+
export interface SetMultiRpcMigrationModalOpen
40+
extends ReduxAction<ActionType.SET_MULTI_RPC_MIGRATION_MODAL_OPEN> {
41+
open: boolean;
42+
}
43+
3844
export interface SetDataCollectionForMarketing
3945
extends ReduxAction<ActionType.SET_DATA_COLLECTION_FOR_MARKETING> {
4046
enabled: boolean;
@@ -46,7 +52,8 @@ export type Action =
4652
| UserSelectedAutomaticSecurityChecksOptions
4753
| SetAutomaticSecurityChecksModalOpen
4854
| SetDataCollectionForMarketing
49-
| SetNftAutoDetectionModalOpen;
55+
| SetNftAutoDetectionModalOpen
56+
| SetMultiRpcMigrationModalOpen;
5057

5158
export const setAllowLoginWithRememberMe = (
5259
enabled: boolean,
@@ -82,6 +89,13 @@ export const setNftAutoDetectionModalOpen = (
8289
open,
8390
});
8491

92+
export const setMultiRpcMigrationModalOpen = (
93+
open: boolean,
94+
): SetMultiRpcMigrationModalOpen => ({
95+
type: ActionType.SET_MULTI_RPC_MIGRATION_MODAL_OPEN,
96+
open,
97+
});
98+
8599
export const setDataCollectionForMarketing = (enabled: boolean) => ({
86100
type: ActionType.SET_DATA_COLLECTION_FOR_MARKETING,
87101
enabled,

app/component-library/components-temp/CellSelectWithMenu/CellSelectWithMenu.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const CellSelectWithMenu = ({
3333
tagLabel,
3434
isSelected = false,
3535
children,
36+
withAvatar = true,
3637
...props
3738
}: CellSelectWithMenuProps) => {
3839
const { styles } = useStyles(styleSheet, { style });
@@ -46,12 +47,15 @@ const CellSelectWithMenu = ({
4647
>
4748
<View style={styles.cellBase}>
4849
{/* DEV Note: Account Avatar should be replaced with Avatar with Badge whenever available */}
49-
<Avatar
50-
style={styles.avatar}
51-
testID={CellModalSelectorsIDs.BASE_AVATAR}
52-
size={DEFAULT_CELLBASE_AVATAR_SIZE}
53-
{...avatarProps}
54-
/>
50+
{withAvatar ? (
51+
<Avatar
52+
style={styles.avatar}
53+
testID={CellModalSelectorsIDs.BASE_AVATAR}
54+
size={DEFAULT_CELLBASE_AVATAR_SIZE}
55+
{...avatarProps}
56+
/>
57+
) : null}
58+
5559
<View style={styles.cellBaseInfo}>
5660
<Text
5761
numberOfLines={1}

app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.styles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const styleSheet = (params: {
2828
position: 'relative',
2929
opacity: isDisabled ? 0.5 : 1,
3030
padding: 16,
31-
width: '95%',
31+
width: '90%',
3232
zIndex: 1,
3333
} as ViewStyle,
3434
style,
@@ -86,6 +86,9 @@ const styleSheet = (params: {
8686
paddingLeft: 8,
8787
paddingTop: 32,
8888
},
89+
buttonIcon: {
90+
paddingHorizontal: 20,
91+
},
8992
});
9093
};
9194

app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.tsx

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,22 @@ import {
2020
IconColor,
2121
IconName,
2222
} from '../../../component-library/components/Icons/Icon';
23+
import Button, {
24+
ButtonSize,
25+
ButtonVariants,
26+
ButtonWidthTypes,
27+
} from '../../../component-library/components/Buttons/Button';
28+
import { TextVariant } from '../../../component-library/components/Texts/Text';
2329

2430
const ListItemMultiSelectButton: React.FC<ListItemMultiSelectButtonProps> = ({
2531
style,
2632
isSelected = false,
2733
isDisabled = false,
2834
children,
2935
gap = DEFAULT_LISTITEMMULTISELECT_GAP,
36+
showButtonIcon = true,
3037
buttonIcon = IconName.MoreVertical,
38+
textButton = null,
3139
...props
3240
}) => {
3341
const { styles } = useStyles(styleSheet, {
@@ -55,15 +63,29 @@ const ListItemMultiSelectButton: React.FC<ListItemMultiSelectButtonProps> = ({
5563
</View>
5664
)}
5765
</TouchableOpacity>
58-
<View>
59-
<ButtonIcon
60-
iconName={buttonIcon}
61-
iconColor={IconColor.Default}
62-
testID={BUTTON_TEST_ID}
63-
onPress={props.onButtonClick}
64-
accessibilityRole="button"
65-
/>
66-
</View>
66+
{showButtonIcon ? (
67+
<View style={styles.buttonIcon}>
68+
<ButtonIcon
69+
iconName={buttonIcon}
70+
iconColor={IconColor.Default}
71+
testID={BUTTON_TEST_ID}
72+
onPress={props.onButtonClick}
73+
accessibilityRole="button"
74+
/>
75+
</View>
76+
) : null}
77+
{textButton ? (
78+
<View>
79+
<Button
80+
variant={ButtonVariants.Link}
81+
onPress={props.onButtonClick as () => void}
82+
labelTextVariant={TextVariant.BodyMD}
83+
size={ButtonSize.Lg}
84+
width={ButtonWidthTypes.Auto}
85+
label={textButton}
86+
/>
87+
</View>
88+
) : null}
6789
</View>
6890
);
6991
};

app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.types.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ export interface ListItemMultiSelectButtonProps
3535
* Optional button onClick rpc modal function
3636
*/
3737
onTextClick?: (() => void) | undefined;
38+
39+
/**
40+
* Optional property to add avatar
41+
*/
42+
withAvatar?: boolean;
43+
44+
/**
45+
* Optional property to show icon
46+
*/
47+
showButtonIcon?: boolean;
48+
/**
49+
* Optional property to show text button
50+
*/
51+
textButton?: string | null;
3852
}
3953

4054
/**

app/components/Nav/App/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ import { SnapsExecutionWebView } from '../../../lib/snaps';
127127
import OptionsSheet from '../../UI/SelectOptionSheet/OptionsSheet';
128128
import FoxLoader from '../../../components/UI/FoxLoader';
129129
import { AppStateEventProcessor } from '../../../core/AppStateEventListener';
130+
import MultiRpcModal from '../../../components/Views/MultiRpcModal/MultiRpcModal';
130131

131132
const clearStackNavigatorOptions = {
132133
headerShown: false,
@@ -396,7 +397,6 @@ const App = (props) => {
396397
});
397398
}, [handleDeeplink]);
398399

399-
400400
useEffect(() => {
401401
if (navigator) {
402402
// Initialize deep link manager
@@ -687,11 +687,14 @@ const App = (props) => {
687687
name={Routes.MODAL.NFT_AUTO_DETECTION_MODAL}
688688
component={NFTAutoDetectionModal}
689689
/>
690+
<Stack.Screen
691+
name={Routes.MODAL.MULTI_RPC_MIGRATION_MODAL}
692+
component={MultiRpcModal}
693+
/>
690694
<Stack.Screen
691695
name={Routes.SHEET.SHOW_TOKEN_ID}
692696
component={ShowTokenIdSheet}
693697
/>
694-
695698
<Stack.Screen
696699
name={Routes.SHEET.ORIGIN_SPAM_MODAL}
697700
component={OriginSpamModal}

app/components/UI/AssetIcon/index.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const mockInitialState = {
1515
selectedAddress: '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3',
1616
useTokenDetection: true,
1717
useNftDetection: false,
18+
showMultiRpcModal: false,
1819
displayNftMedia: true,
1920
useSafeChainsListValidation: false,
2021
isMultiAccountBalancesEnabled: true,
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { StyleSheet } from 'react-native';
2+
3+
/**
4+
* Style sheet function for NFT auto detection modal component.
5+
*
6+
* @returns StyleSheet object.
7+
*/
8+
const styleSheet = () =>
9+
StyleSheet.create({
10+
container: {
11+
alignItems: 'center',
12+
},
13+
image: {
14+
width: 102.64,
15+
height: 102.64,
16+
},
17+
description: {
18+
marginLeft: 32,
19+
marginRight: 32,
20+
},
21+
content: {
22+
height: '80%',
23+
},
24+
textDescription: {
25+
textAlign: 'center',
26+
},
27+
textContainer: {
28+
// paddingTop: 24,
29+
marginLeft: 16,
30+
marginRight: 16,
31+
paddingVertical: 16,
32+
},
33+
buttonsContainer: {
34+
// paddingTop: 24,
35+
marginLeft: 16,
36+
marginRight: 16,
37+
paddingVertical: 16,
38+
},
39+
spacer: { height: 8 },
40+
});
41+
42+
export default styleSheet;

0 commit comments

Comments
 (0)