Skip to content

Commit

Permalink
feat: add linea mainnet logo
Browse files Browse the repository at this point in the history
  • Loading branch information
VGau committed Jun 7, 2023
1 parent 9cb2ba7 commit 7350705
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
16 changes: 6 additions & 10 deletions app/components/Views/Settings/NetworksSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,12 @@ class NetworksSettings extends PureComponent {
);
};

componentDidMount = () => {
async function getLineaMainnetStatus() {
const shouldShowLineaMainnet = await shouldShowLineaMainnetNetwork(
LINEA_MAINNET_RPC_URL,
);
componentDidMount = async () => {
const shouldShowLineaMainnet = await shouldShowLineaMainnetNetwork(
LINEA_MAINNET_RPC_URL,
);

if (shouldShowLineaMainnet) {
this.setState({ lineaMainnetReleased: shouldShowLineaMainnet });
}
}
getLineaMainnetStatus();
this.setState({ lineaMainnetReleased: shouldShowLineaMainnet });
this.updateNavBar();
};

Expand Down Expand Up @@ -414,6 +409,7 @@ class NetworksSettings extends PureComponent {
const { network, chainId, name, color, isCustomRPC } = data;
const image = getNetworkImageSource({ chainId });
return (
// TODO: remove this check when linea mainnet is ready
network !== LINEA_MAINNET &&
this.networkElement(name, image || color, i, network, isCustomRPC)
);
Expand Down
3 changes: 1 addition & 2 deletions app/images/image-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import AVAX from './avalanche.png';
import GOERLI from './goerli-logo-dark.png';
import LINEA_GOERLI from './linea-testnet-logo.png';
import SEPOLIA from './sepolia-logo-dark.png';
// eslint-disable-next-line no-duplicate-imports, import/no-duplicates
import LINEA_MAINNET from './linea-logo-dark.png';
import LINEA_MAINNET from './linea-mainnet-logo.png';

export default {
PALM,
Expand Down
Binary file added app/images/linea-mainnet-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions app/util/networks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export { handleNetworkSwitch };
const ethLogo = require('../../images/eth-logo-new.png');
const goerliLogo = require('../../images/goerli-logo-dark.png');
const sepoliaLogo = require('../../images/sepolia-logo-dark.png');
const lineaLogo = require('../../images/linea-testnet-logo.png');
const lineaGoerliLogo = require('../../images/linea-testnet-logo.png');
const lineaMainnetLogo = require('../../images/linea-mainnet-logo.png');

/* eslint-enable */
import PopularList from './customNetworks';
Expand Down Expand Up @@ -67,7 +68,7 @@ const NetworkList = {
hexChainId: '0xe704',
color: '#121212',
networkType: 'linea-mainnet',
imageSource: lineaLogo,
imageSource: lineaMainnetLogo,
},
[GOERLI]: {
name: 'Goerli Test Network',
Expand Down Expand Up @@ -97,7 +98,7 @@ const NetworkList = {
hexChainId: '0xe704',
color: '#61dfff',
networkType: 'linea-goerli',
imageSource: lineaLogo,
imageSource: lineaGoerliLogo,
},
[RPC]: {
name: 'Private Network',
Expand Down Expand Up @@ -480,5 +481,5 @@ export const shouldShowLineaMainnetNetwork = async (rpcUrl) => {
chainId = null;
}

return currentDateHigherThanReleaseDate && chainId;
return currentDateHigherThanReleaseDate && Boolean(chainId);
};

0 comments on commit 7350705

Please sign in to comment.