@@ -60,6 +60,12 @@ const propTypes = {
60
60
walletLinkedAccountType : PropTypes . string ,
61
61
} ) ,
62
62
63
+ /** Type of active/highlighted payment method */
64
+ actionPaymentMethodType : PropTypes . oneOf ( [ ..._ . values ( CONST . PAYMENT_METHODS ) , '' ] ) ,
65
+
66
+ /** ID of active/highlighted payment method */
67
+ activePaymentMethodID : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
68
+
63
69
/** ID of selected payment method */
64
70
selectedMethodID : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
65
71
@@ -78,6 +84,8 @@ const defaultProps = {
78
84
isAddPaymentMenuActive : false ,
79
85
shouldShowAddPaymentMethodButton : true ,
80
86
filterType : '' ,
87
+ actionPaymentMethodType : '' ,
88
+ activePaymentMethodID : '' ,
81
89
selectedMethodID : '' ,
82
90
} ;
83
91
@@ -104,6 +112,8 @@ class PaymentMethodList extends Component {
104
112
...paymentMethod ,
105
113
type : MENU_ITEM ,
106
114
onPress : e => this . props . onPress ( e , paymentMethod . accountType , paymentMethod . accountData ) ,
115
+ iconFill : this . isPaymentMethodActive ( paymentMethod ) ? StyleUtils . getIconFillColor ( CONST . BUTTON_STATES . PRESSED ) : null ,
116
+ wrapperStyle : this . isPaymentMethodActive ( paymentMethod ) ? [ StyleUtils . getButtonBackgroundColorStyle ( CONST . BUTTON_STATES . PRESSED ) ] : null ,
107
117
} ) ) ;
108
118
109
119
// If we have not added any payment methods, show a default empty state
@@ -132,6 +142,16 @@ class PaymentMethodList extends Component {
132
142
return combinedPaymentMethods ;
133
143
}
134
144
145
+ /**
146
+ * @param {Object } paymentMethod
147
+ * @param {String|Number } paymentMethod.methodID
148
+ * @param {String } paymentMethod.accountType
149
+ * @return {Boolean }
150
+ */
151
+ isPaymentMethodActive ( paymentMethod ) {
152
+ return paymentMethod . accountType === this . props . actionPaymentMethodType && paymentMethod . methodID === this . props . activePaymentMethodID ;
153
+ }
154
+
135
155
/**
136
156
* Create a menuItem for each passed paymentMethod
137
157
*
0 commit comments