Skip to content

Commit

Permalink
merge: merge of remove feature flag + fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
salimtb committed Oct 9, 2024
1 parent 37d0585 commit eacb5b8
Show file tree
Hide file tree
Showing 23 changed files with 552 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ListItemMultiSelectButtonProps } from './ListItemMultiSelectButton.type
// Defaults
export const DEFAULT_LISTITEMMULTISELECT_GAP = 16;
export const BUTTON_TEST_ID = 'button-menu-select-test-id';
export const BUTTON_TEXT_TEST_ID = 'button-text-select-test-id';

// Sample consts
export const SAMPLE_LISTITEMMULTISELECT_PROPS: ListItemMultiSelectButtonProps =
Expand Down
5 changes: 4 additions & 1 deletion app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,10 @@ const App = (props) => {
component={MultiRpcModal}
/>
) : null}

<Stack.Screen
name={Routes.MODAL.MULTI_RPC_MIGRATION_MODAL}
component={MultiRpcModal}
/>
<Stack.Screen
name={Routes.MODAL.MULTI_RPC_MIGRATION_MODAL}
component={MultiRpcModal}
Expand Down
1 change: 0 additions & 1 deletion app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ const Main = (props) => {
networkImageSource: networkImage,
});
}

previousNetworkConfigurations.current = networkConfigurations;
}, [networkConfigurations, networkName, networkImage, toastRef]);

Expand Down
5 changes: 4 additions & 1 deletion app/components/UI/NetworkModal/NetworkAdded/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const createStyles = (colors: any) =>
flexDirection: 'row',
paddingVertical: 16,
},
base: {
padding: 16,
},
button: {
flex: 1,
},
Expand Down Expand Up @@ -41,7 +44,7 @@ const NetworkAdded = (props: NetworkAddedProps) => {
const styles = createStyles(colors);

return (
<View>
<View style={styles.base}>
<Text centered bold black big>
{strings('networks.new_network')}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -703,7 +703,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -1444,7 +1444,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -1492,10 +1492,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -1598,7 +1595,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -1648,10 +1645,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -2297,7 +2291,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -2451,7 +2445,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -2605,7 +2599,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -2653,10 +2647,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -2759,7 +2750,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -2809,10 +2800,7 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -3458,7 +3446,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -3612,7 +3600,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -3766,7 +3754,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -3814,10 +3802,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -3920,7 +3905,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -3970,10 +3955,7 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -4619,7 +4601,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -4773,7 +4755,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -4927,7 +4909,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -4975,10 +4957,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down Expand Up @@ -5081,7 +5060,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
{
"borderRadius": 10,
"height": 20,
"marginRight": 10,
"marginRight": 20,
"width": 20,
}
}
Expand Down Expand Up @@ -5131,10 +5110,7 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
},
undefined,
undefined,
{
"fontFamily": "EuclidCircularB-Bold",
"fontWeight": "600",
},
false,
undefined,
undefined,
undefined,
Expand Down
20 changes: 12 additions & 8 deletions app/components/Views/NetworkSelector/NetworkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,17 @@ const NetworkSelector = () => {
networkName: mainnetName,
})
}
onLongPress={() => {
openModal(chainId, false, MAINNET, true);
}}
/>
);
}

return (
<Cell
variant={CellVariant.Select}
title={mainnetName}
title={name}
avatarProps={{
variant: AvatarVariant.Network,
name: mainnetName,
Expand All @@ -474,6 +477,7 @@ const NetworkSelector = () => {

const renderLineaMainnet = () => {
const { name: lineaMainnetName, chainId } = Networks['linea-mainnet'];
const name = networkConfigurations?.[chainId]?.name ?? lineaMainnetName;

if (isNetworkUiRedesignEnabled() && isNoSearchResults('linea-mainnet'))
return null;
Expand All @@ -483,7 +487,7 @@ const NetworkSelector = () => {
<Cell
key={chainId}
variant={CellVariant.SelectWithMenu}
title={lineaMainnetName}
title={name}
avatarProps={{
variant: AvatarVariant.Network,
name: lineaMainnetName,
Expand All @@ -506,14 +510,17 @@ const NetworkSelector = () => {
networkName: lineaMainnetName,
})
}
onLongPress={() => {
openModal(chainId, false, LINEA_MAINNET, true);
}}
/>
);
}

return (
<Cell
variant={CellVariant.Select}
title={lineaMainnetName}
title={name}
avatarProps={{
variant: AvatarVariant.Network,
name: lineaMainnetName,
Expand Down Expand Up @@ -989,11 +996,7 @@ const NetworkSelector = () => {
>
<View style={styles.networkMenu}>
<AccountAction
actionTitle={strings(
showNetworkMenuModal.isReadOnly
? 'networks.view_details'
: 'transaction.edit',
)}
actionTitle={strings('transaction.edit')}
iconName={IconName.Edit}
onPress={() => {
sheetRef.current?.onCloseBottomSheet(() => {
Expand All @@ -1011,6 +1014,7 @@ const NetworkSelector = () => {
actionTitle={strings('app_settings.delete')}
iconName={IconName.Trash}
onPress={() => removeRpcUrl(showNetworkMenuModal.chainId)}
testID={`delete-network-button-${showNetworkMenuModal.chainId}`}
/>
) : null}
</View>
Expand Down
Loading

0 comments on commit eacb5b8

Please sign in to comment.