AugurProject/augur-ui

View on GitHub
src/modules/common/containers/etherscan-link.js

Summary

Maintainability
A
0 mins
Test Coverage
import { connect } from "react-redux";
import EtherscanLink from "modules/common/components/etherscan-link";

const mapStateToProps = state => {
  const networkId = state.connection.augurNodeNetworkId;
  const networkLink = {
    1: "https://etherscan.io/tx/",
    3: "https://ropsten.etherscan.io/tx/",
    4: "https://rinkeby.etherscan.io/tx/",
    19: "http://scan.thundercore.com/tx/"
  };

  return {
    baseUrl: networkLink[networkId]
  };
};

const etherscan = connect(mapStateToProps)(EtherscanLink);

export default etherscan;