Skip to content

Commit 963f438

Browse files
committed
Merge branch 'salim/bump-network-controller-21.0.0-migration' into salim/default-rpc-feature
1 parent 3924dd6 commit 963f438

File tree

29 files changed

+811
-285
lines changed

29 files changed

+811
-285
lines changed

app/component-library/components-temp/CellSelectWithMenu/__snapshots__/CellSelectWithMenu.test.tsx.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] =
77
"alignItems": "center",
88
"backgroundColor": "#ffffff",
99
"flexDirection": "row",
10-
"paddingRight": 20,
11-
"width": "100%",
1210
}
1311
}
1412
>
1513
<TouchableOpacity
1614
disabled={false}
1715
style={
1816
{
17+
"flex": 1,
1918
"opacity": 1,
2019
"padding": 16,
2120
"position": "relative",
22-
"width": "90%",
2321
"zIndex": 1,
2422
}
2523
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ListItemMultiSelectButtonProps } from './ListItemMultiSelectButton.type
88
// Defaults
99
export const DEFAULT_LISTITEMMULTISELECT_GAP = 16;
1010
export const BUTTON_TEST_ID = 'button-menu-select-test-id';
11+
export const BUTTON_TEXT_TEST_ID = 'button-text-select-test-id';
1112

1213
// Sample consts
1314
export const SAMPLE_LISTITEMMULTISELECT_PROPS: ListItemMultiSelectButtonProps =

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ const styleSheet = (params: {
2525
return StyleSheet.create({
2626
base: Object.assign(
2727
{
28+
flex: 1,
2829
position: 'relative',
2930
opacity: isDisabled ? 0.5 : 1,
3031
padding: 16,
31-
width: '90%',
3232
zIndex: 1,
3333
} as ViewStyle,
3434
style,
@@ -71,10 +71,8 @@ const styleSheet = (params: {
7171
backgroundColor: isSelected
7272
? colors.primary.muted
7373
: colors.background.default,
74-
paddingRight: 20,
7574
flexDirection: 'row',
7675
alignItems: 'center',
77-
width: '100%',
7876
},
7977
itemColumn: {
8078
display: 'flex',

app/component-library/components-temp/ListItemMultiSelectButton/__snapshots__/ListItemMultiSelectButton.test.tsx.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ exports[`ListItemMultiSelectButton should render correctly with default props 1`
77
"alignItems": "center",
88
"backgroundColor": "#ffffff",
99
"flexDirection": "row",
10-
"paddingRight": 20,
11-
"width": "100%",
1210
}
1311
}
1412
>
1513
<TouchableOpacity
1614
disabled={false}
1715
style={
1816
{
17+
"flex": 1,
1918
"opacity": 1,
2019
"padding": 16,
2120
"position": "relative",
22-
"width": "90%",
2321
"zIndex": 1,
2422
}
2523
}

app/components/Nav/App/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,6 @@ const App = (props) => {
711711
component={MultiRpcModal}
712712
/>
713713
) : null}
714-
715714
<Stack.Screen
716715
name={Routes.SHEET.SHOW_TOKEN_ID}
717716
component={ShowTokenIdSheet}

app/components/Nav/Main/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ const Main = (props) => {
294294
networkImageSource: networkImage,
295295
});
296296
}
297-
298297
previousNetworkConfigurations.current = networkConfigurations;
299298
}, [networkConfigurations, networkName, networkImage, toastRef]);
300299

app/components/UI/NetworkModal/NetworkAdded/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const createStyles = (colors: any) =>
1414
flexDirection: 'row',
1515
paddingVertical: 16,
1616
},
17+
base: {
18+
padding: 16,
19+
},
1720
button: {
1821
flex: 1,
1922
},
@@ -41,7 +44,7 @@ const NetworkAdded = (props: NetworkAddedProps) => {
4144
const styles = createStyles(colors);
4245

4346
return (
44-
<View>
47+
<View style={styles.base}>
4548
<Text centered bold black big>
4649
{strings('networks.new_network')}
4750
</Text>

app/components/UI/NetworkModal/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ const NetworkModals = (props: NetworkProps) => {
205205
!isPrivateConnection(url.hostname) && url.set('protocol', 'https:');
206206

207207
const existingNetwork = networkConfigurationByChainId[chainId];
208+
let networkClientId;
208209

209210
if (existingNetwork) {
210211
const updatedNetwork = await NetworkController.updateNetwork(
@@ -218,12 +219,9 @@ const NetworkModals = (props: NetworkProps) => {
218219
: undefined,
219220
);
220221

221-
const { networkClientId } =
222-
updatedNetwork?.rpcEndpoints?.[
223-
updatedNetwork.defaultRpcEndpointIndex
224-
] ?? {};
225-
226-
await NetworkController.setActiveNetwork(networkClientId);
222+
networkClientId =
223+
updatedNetwork?.rpcEndpoints?.[updatedNetwork.defaultRpcEndpointIndex]
224+
?.networkClientId;
227225
} else {
228226
const addedNetwork = await NetworkController.addNetwork({
229227
chainId,
@@ -241,12 +239,15 @@ const NetworkModals = (props: NetworkProps) => {
241239
],
242240
});
243241

244-
const { networkClientId } =
245-
addedNetwork?.rpcEndpoints?.[addedNetwork.defaultRpcEndpointIndex] ??
246-
{};
242+
networkClientId =
243+
addedNetwork?.rpcEndpoints?.[addedNetwork.defaultRpcEndpointIndex]
244+
?.networkClientId;
245+
}
247246

247+
if (networkClientId) {
248248
await NetworkController.setActiveNetwork(networkClientId);
249249
}
250+
250251
onClose();
251252
};
252253

app/components/UI/Ramp/Views/NetworkSwitcher/__snapshots__/NetworkSwitcher.test.tsx.snap

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
549549
{
550550
"borderRadius": 10,
551551
"height": 20,
552-
"marginRight": 10,
552+
"marginRight": 20,
553553
"width": 20,
554554
}
555555
}
@@ -703,7 +703,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
703703
{
704704
"borderRadius": 10,
705705
"height": 20,
706-
"marginRight": 10,
706+
"marginRight": 20,
707707
"width": 20,
708708
}
709709
}
@@ -1444,7 +1444,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
14441444
{
14451445
"borderRadius": 10,
14461446
"height": 20,
1447-
"marginRight": 10,
1447+
"marginRight": 20,
14481448
"width": 20,
14491449
}
14501450
}
@@ -1492,10 +1492,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
14921492
},
14931493
undefined,
14941494
undefined,
1495-
{
1496-
"fontFamily": "EuclidCircularB-Bold",
1497-
"fontWeight": "600",
1498-
},
1495+
false,
14991496
undefined,
15001497
undefined,
15011498
undefined,
@@ -1598,7 +1595,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
15981595
{
15991596
"borderRadius": 10,
16001597
"height": 20,
1601-
"marginRight": 10,
1598+
"marginRight": 20,
16021599
"width": 20,
16031600
}
16041601
}
@@ -1648,10 +1645,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
16481645
},
16491646
undefined,
16501647
undefined,
1651-
{
1652-
"fontFamily": "EuclidCircularB-Bold",
1653-
"fontWeight": "600",
1654-
},
1648+
false,
16551649
undefined,
16561650
undefined,
16571651
undefined,
@@ -2297,7 +2291,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
22972291
{
22982292
"borderRadius": 10,
22992293
"height": 20,
2300-
"marginRight": 10,
2294+
"marginRight": 20,
23012295
"width": 20,
23022296
}
23032297
}
@@ -2451,7 +2445,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
24512445
{
24522446
"borderRadius": 10,
24532447
"height": 20,
2454-
"marginRight": 10,
2448+
"marginRight": 20,
24552449
"width": 20,
24562450
}
24572451
}
@@ -2605,7 +2599,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
26052599
{
26062600
"borderRadius": 10,
26072601
"height": 20,
2608-
"marginRight": 10,
2602+
"marginRight": 20,
26092603
"width": 20,
26102604
}
26112605
}
@@ -2653,10 +2647,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
26532647
},
26542648
undefined,
26552649
undefined,
2656-
{
2657-
"fontFamily": "EuclidCircularB-Bold",
2658-
"fontWeight": "600",
2659-
},
2650+
false,
26602651
undefined,
26612652
undefined,
26622653
undefined,
@@ -2759,7 +2750,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
27592750
{
27602751
"borderRadius": 10,
27612752
"height": 20,
2762-
"marginRight": 10,
2753+
"marginRight": 20,
27632754
"width": 20,
27642755
}
27652756
}
@@ -2809,10 +2800,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
28092800
},
28102801
undefined,
28112802
undefined,
2812-
{
2813-
"fontFamily": "EuclidCircularB-Bold",
2814-
"fontWeight": "600",
2815-
},
2803+
false,
28162804
undefined,
28172805
undefined,
28182806
undefined,
@@ -3458,7 +3446,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
34583446
{
34593447
"borderRadius": 10,
34603448
"height": 20,
3461-
"marginRight": 10,
3449+
"marginRight": 20,
34623450
"width": 20,
34633451
}
34643452
}
@@ -3612,7 +3600,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
36123600
{
36133601
"borderRadius": 10,
36143602
"height": 20,
3615-
"marginRight": 10,
3603+
"marginRight": 20,
36163604
"width": 20,
36173605
}
36183606
}
@@ -3766,7 +3754,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
37663754
{
37673755
"borderRadius": 10,
37683756
"height": 20,
3769-
"marginRight": 10,
3757+
"marginRight": 20,
37703758
"width": 20,
37713759
}
37723760
}
@@ -3814,10 +3802,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
38143802
},
38153803
undefined,
38163804
undefined,
3817-
{
3818-
"fontFamily": "EuclidCircularB-Bold",
3819-
"fontWeight": "600",
3820-
},
3805+
false,
38213806
undefined,
38223807
undefined,
38233808
undefined,
@@ -3920,7 +3905,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
39203905
{
39213906
"borderRadius": 10,
39223907
"height": 20,
3923-
"marginRight": 10,
3908+
"marginRight": 20,
39243909
"width": 20,
39253910
}
39263911
}
@@ -3970,10 +3955,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
39703955
},
39713956
undefined,
39723957
undefined,
3973-
{
3974-
"fontFamily": "EuclidCircularB-Bold",
3975-
"fontWeight": "600",
3976-
},
3958+
false,
39773959
undefined,
39783960
undefined,
39793961
undefined,
@@ -4619,7 +4601,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
46194601
{
46204602
"borderRadius": 10,
46214603
"height": 20,
4622-
"marginRight": 10,
4604+
"marginRight": 20,
46234605
"width": 20,
46244606
}
46254607
}
@@ -4773,7 +4755,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
47734755
{
47744756
"borderRadius": 10,
47754757
"height": 20,
4776-
"marginRight": 10,
4758+
"marginRight": 20,
47774759
"width": 20,
47784760
}
47794761
}
@@ -4927,7 +4909,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
49274909
{
49284910
"borderRadius": 10,
49294911
"height": 20,
4930-
"marginRight": 10,
4912+
"marginRight": 20,
49314913
"width": 20,
49324914
}
49334915
}
@@ -4975,10 +4957,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
49754957
},
49764958
undefined,
49774959
undefined,
4978-
{
4979-
"fontFamily": "EuclidCircularB-Bold",
4980-
"fontWeight": "600",
4981-
},
4960+
false,
49824961
undefined,
49834962
undefined,
49844963
undefined,
@@ -5081,7 +5060,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
50815060
{
50825061
"borderRadius": 10,
50835062
"height": 20,
5084-
"marginRight": 10,
5063+
"marginRight": 20,
50855064
"width": 20,
50865065
}
50875066
}
@@ -5131,10 +5110,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
51315110
},
51325111
undefined,
51335112
undefined,
5134-
{
5135-
"fontFamily": "EuclidCircularB-Bold",
5136-
"fontWeight": "600",
5137-
},
5113+
false,
51385114
undefined,
51395115
undefined,
51405116
undefined,

0 commit comments

Comments
 (0)