Skip to content

Commit

Permalink
Fix network color indicator on transactionHeader for connect screens (#…
Browse files Browse the repository at this point in the history
…1628)

* Use network colors
  • Loading branch information
rickycodes authored Jun 15, 2020
1 parent dd2852b commit a277fe1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/components/UI/NavbarBrowserTitle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class NavbarBrowserTitle extends PureComponent {
</Text>
</View>
<View style={styles.network}>
<View style={[styles.networkIcon, color ? { backgroundColor: color } : styles.otherNetworkIcon]} />
<View style={[styles.networkIcon, { backgroundColor: color || colors.red }]} />
<Text style={styles.networkName} testID={'navbar-title-network'}>
{name}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports[`TransactionHeader should render correctly 1`] = `
"width": 5,
},
Object {
"backgroundColor": "green",
"backgroundColor": "#ff4a8d",
},
]
}
Expand Down
10 changes: 3 additions & 7 deletions app/components/UI/TransactionHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ class TransactionHeader extends PureComponent {
/**
* String representing the selected network
*/
networkType: PropTypes.string,
/**
* Object representing the status of infura networks
*/
networkStatus: PropTypes.object
networkType: PropTypes.string
};

/**
Expand All @@ -83,8 +79,8 @@ class TransactionHeader extends PureComponent {
* @return {element} - JSX view element
*/
renderNetworkStatusIndicator = () => {
const { networkType, networkStatus } = this.props;
const networkStatusIndicatorColor = networkStatus[networkType] === 'ok' ? 'green' : 'red';
const { networkType } = this.props;
const networkStatusIndicatorColor = (networkList[networkType] && networkList[networkType].color) || colors.red;
const networkStatusIndicator = (
<View style={[styles.networkStatusIndicator, { backgroundColor: networkStatusIndicatorColor }]} />
);
Expand Down

0 comments on commit a277fe1

Please sign in to comment.