Skip to content

Commit 7e38ed2

Browse files
committed
fix: fix multi rpc modal design
1 parent ea3948c commit 7e38ed2

File tree

8 files changed

+26
-32
lines changed

8 files changed

+26
-32
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.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/ListItemMultiSelectButton.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ describe('ListItemMultiSelectButton', () => {
4242
<ListItemMultiSelectButton
4343
onPress={mockOnPress}
4444
buttonProps={{
45-
onButtonClick: mockOnPress,
45+
label: '',
46+
onPress: mockOnPress,
4647
}}
4748
>
4849
<View />
@@ -67,7 +68,8 @@ describe('ListItemMultiSelectButton', () => {
6768
<ListItemMultiSelectButton
6869
buttonIcon={IconName.Check}
6970
buttonProps={{
70-
onButtonClick: mockOnButtonClick,
71+
label: '',
72+
onPress: mockOnButtonClick,
7173
}}
7274
>
7375
<View />

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ const ListItemMultiSelectButton: React.FC<ListItemMultiSelectButtonProps> = ({
6969
iconName={buttonIcon}
7070
iconColor={IconColor.Default}
7171
testID={BUTTON_TEST_ID}
72-
onPress={buttonProps?.onButtonClick}
72+
onPress={buttonProps?.onPress}
7373
accessibilityRole="button"
7474
/>
7575
</View>
7676
) : null}
77-
{buttonProps?.textButton ? (
77+
{buttonProps?.label ? (
7878
<View>
7979
<Button
8080
variant={ButtonVariants.Link}
81-
onPress={buttonProps?.onButtonClick as () => void}
81+
onPress={buttonProps?.onPress as () => void}
8282
labelTextVariant={TextVariant.BodyMD}
8383
size={ButtonSize.Lg}
8484
width={ButtonWidthTypes.Auto}
85-
label={buttonProps?.textButton}
85+
label={buttonProps?.label}
8686
/>
8787
</View>
8888
) : null}

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { TouchableOpacityProps } from 'react-native';
44
// External dependencies.
55
import { IconName } from '../../../component-library/components/Icons/Icon';
66
import { ListItemProps } from '../../../component-library/components/List/ListItem/ListItem.types';
7-
import { GestureResponderEvent } from 'react-native-modal';
7+
import { ButtonBaseProps } from '../../../component-library/components/Buttons/Button/foundation/ButtonBase';
88

99
/**
1010
* ListItemMultiSelect component props.
@@ -41,16 +41,10 @@ export interface ListItemMultiSelectButtonProps
4141
*/
4242
showButtonIcon?: boolean;
4343

44-
buttonProps?: {
45-
/**
46-
* Optional button onClick function
47-
*/
48-
onButtonClick?: ((event: GestureResponderEvent) => void) | undefined;
49-
/**
50-
* Optional property to show text button
51-
*/
52-
textButton?: string | null;
53-
};
44+
/**
45+
* Optional button props
46+
*/
47+
buttonProps?: ButtonBaseProps;
5448
}
5549

5650
/**

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/Views/MultiRpcModal/MultiRpcModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const MultiRpcModal = () => {
105105
buttonIcon={IconName.MoreVertical}
106106
showButtonIcon={false}
107107
buttonProps={{
108-
textButton: strings('transaction.edit'),
109-
onButtonClick: () => {
108+
label: strings('transaction.edit'),
109+
onPress: () => {
110110
sheetRef.current?.onCloseBottomSheet(() => {
111111
navigate(Routes.ADD_NETWORK, {
112112
shouldNetworkSwitchPopToWallet: false,

app/components/Views/NetworkSelector/NetworkSelector.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ const NetworkSelector = () => {
387387
style={styles.networkCell}
388388
buttonIcon={IconName.MoreVertical}
389389
buttonProps={{
390-
onButtonClick: () => {
390+
label: '',
391+
onPress: () => {
391392
openModal(chainId, false, MAINNET, true);
392393
},
393394
}}
@@ -444,7 +445,8 @@ const NetworkSelector = () => {
444445
buttonIcon={IconName.MoreVertical}
445446
secondaryText={hideKeyFromUrl(LINEA_DEFAULT_RPC_URL)}
446447
buttonProps={{
447-
onButtonClick: () => {
448+
label: '',
449+
onPress: () => {
448450
openModal(chainId, false, LINEA_MAINNET, true);
449451
},
450452
}}
@@ -508,7 +510,8 @@ const NetworkSelector = () => {
508510
buttonIcon={IconName.MoreVertical}
509511
secondaryText={hideProtocolFromUrl(hideKeyFromUrl(rpcUrl))}
510512
buttonProps={{
511-
onButtonClick: () => {
513+
label: '',
514+
onPress: () => {
512515
openModal(chainId, true, rpcUrl, false);
513516
},
514517
}}
@@ -580,7 +583,8 @@ const NetworkSelector = () => {
580583
style={styles.networkCell}
581584
buttonIcon={IconName.MoreVertical}
582585
buttonProps={{
583-
onButtonClick: () => {
586+
label: '',
587+
onPress: () => {
584588
openModal(chainId, false, networkType, true);
585589
},
586590
}}

0 commit comments

Comments
 (0)