Refactor: Use global donation mapping instead of hardcoding donation address in footer

This commit is contained in:
Daniel Ternyak 2017-06-23 20:27:17 -05:00
parent 943a0532d7
commit 07bde87658
2 changed files with 359 additions and 251 deletions

View File

@ -1,100 +1,202 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import translate, {getTranslators} from 'translations'; import translate, { getTranslators } from 'translations';
import { DONATION_ADDRESSES_MAP } from 'config/data';
export default class Footer extends Component { export default class Footer extends Component {
render() { render() {
const translators = getTranslators() const translators = getTranslators();
return ( return (
<footer role="contentinfo" aria-label="footer"> <footer role="contentinfo" aria-label="footer">
<div className="container"> <div className="container">
<section className="row"> <section className="row">
<section className="row"> <section className="row">
<div className="col-sm-3 footer-1"> <div className="col-sm-3 footer-1">
<p aria-hidden="true"> <p aria-hidden="true">
<a href="/"> <a href="/">
{/* TODO - don't hardcode image path*/} {/* TODO - don't hardcode image path*/}
<img src={'https://www.myetherwallet.com/images/logo-myetherwallet.svg'} <img
height="55px" width="auto" alt="Ether Wallet"/> src={
</a> 'https://www.myetherwallet.com/images/logo-myetherwallet.svg'
</p> }
<p><span>{translate('FOOTER_1')}</span> height="55px"
<span>{translate('FOOTER_1b')}</span> width="auto"
<a aria-label="kvhnuke's github" alt="Ether Wallet"
href="https://github.com/kvhnuke" />
target="_blank">kvhnuke</a> </a>
{' & '} </p>
<a aria-label="tayvano's github" <p>
href="https://github.com/tayvano" <span>{translate('FOOTER_1')}</span>
target="_blank">tayvano</a>. <span>{translate('FOOTER_1b')}</span>
</p> <a
<br/> aria-label="kvhnuke's github"
</div> href="https://github.com/kvhnuke"
<div className="col-sm-6 footer-2"> target="_blank"
<h5><i aria-hidden="true">💝</i>{translate('FOOTER_2')}</h5> >
<ul> kvhnuke
<li> ETH: <span </a>
className="mono wrap">0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8</span> {' & '}
</li> <a
<li> BTC: <span className="mono wrap">1MEWT2SGbqtz6mPCgFcnea8XmWV5Z4Wc6</span></li> aria-label="tayvano's github"
</ul> href="https://github.com/tayvano"
target="_blank"
>
tayvano
</a>.
</p>
<br />
</div>
<div className="col-sm-6 footer-2">
<h5><i aria-hidden="true">💝</i>{translate('FOOTER_2')}</h5>
<ul>
<li>
{' '}ETH:{' '}
<span className="mono wrap">
{DONATION_ADDRESSES_MAP.ETH}
</span>
</li>
<li>
{' '}BTC:{' '}
<span className="mono wrap">
{DONATION_ADDRESSES_MAP.BTC}
</span>
</li>
</ul>
<h5><i aria-hidden="true">👫</i>{translate('ADD_Warning_1')}</h5> <h5>
<p>Consider using our affiliate links to...</p> <i aria-hidden="true">👫</i>{translate('ADD_Warning_1')}
<ul> </h5>
<li><a aria-label="Swap Ether or Bitcoin via Bity.com" <p>Consider using our affiliate links to...</p>
href="https://bity.com/af/jshkb37v" target="_blank">Swap ETH/BTC/EUR/CHF via <ul>
Bity.com</a></li> <li>
<li><a href="https://www.ledgerwallet.com/r/fa4b?path=/products/" target="_blank">Buy <a
a aria-label="Swap Ether or Bitcoin via Bity.com"
Ledger Nano S</a></li> href="https://bity.com/af/jshkb37v"
<li><a href="https://trezor.io/?a=myetherwallet.com" target="_blank">Buy a target="_blank"
TREZOR</a> >
</li> Swap ETH/BTC/EUR/CHF via
</ul> Bity.com
</a>
</li>
<li>
<a
href="https://www.ledgerwallet.com/r/fa4b?path=/products/"
target="_blank"
>
Buy
a
Ledger Nano S
</a>
</li>
<li>
<a
href="https://trezor.io/?a=myetherwallet.com"
target="_blank"
>
Buy a
TREZOR
</a>
</li>
</ul>
{!!translators.length && {!!translators.length &&
<h5> <i>🏅</i> <span>{translate('Translator_Desc')}</span></h5> <h5>
} {' '}<i>🏅</i> <span>{translate('Translator_Desc')}</span>
{!!translators.length && </h5>}
<ul> {!!translators.length &&
<li>{translators.map(key => <span key={key}>{translate(key)}</span>)}</li> <ul>
</ul> <li>
} {translators.map(key =>
</div> <span key={key}>{translate(key)}</span>
<div className="col-sm-3 footer-3"> )}
<h5><i aria-hidden="true">🌎</i> On the Web</h5> </li>
<ul> </ul>}
<li><a aria-label="my ether wallet.com" href="https://www.MyEtherWallet.com" </div>
target="_blank">www.MyEtherWallet.com</a></li> <div className="col-sm-3 footer-3">
<li><a aria-label="my ether wallet github" <h5><i aria-hidden="true">🌎</i> On the Web</h5>
href="https://github.com/kvhnuke/etherwallet" <ul>
target="_blank">Github: MyEtherWallet.com & CX</a></li> <li>
<li><a aria-label="our organization on github" <a
href="https://github.com/MyEtherWallet" aria-label="my ether wallet.com"
target="_blank">Github: MyEtherWallet (Org)</a></li> href="https://www.MyEtherWallet.com"
<li><a aria-label="join our slack" href="https://myetherwallet.herokuapp.com/" target="_blank"
target="_blank">Join Our Slack</a></li> >
<li><a aria-label="twitter" href="https://twitter.com/myetherwallet" www.MyEtherWallet.com
target="_blank">Twitter</a> </a>
</li> </li>
<li><a aria-label="facebook" href="https://www.facebook.com/MyEtherWallet/" <li>
target="_blank">Facebook</a></li> <a
</ul> aria-label="my ether wallet github"
href="https://github.com/kvhnuke/etherwallet"
target="_blank"
>
Github: MyEtherWallet.com & CX
</a>
</li>
<li>
<a
aria-label="our organization on github"
href="https://github.com/MyEtherWallet"
target="_blank"
>
Github: MyEtherWallet (Org)
</a>
</li>
<li>
<a
aria-label="join our slack"
href="https://myetherwallet.herokuapp.com/"
target="_blank"
>
Join Our Slack
</a>
</li>
<li>
<a
aria-label="twitter"
href="https://twitter.com/myetherwallet"
target="_blank"
>
Twitter
</a>
</li>
<li>
<a
aria-label="facebook"
href="https://www.facebook.com/MyEtherWallet/"
target="_blank"
>
Facebook
</a>
</li>
</ul>
<h5><i aria-hidden="true">🙏</i> Support</h5> <h5><i aria-hidden="true">🙏</i> Support</h5>
<ul> <ul>
<li><a aria-label="email support at myetherwallet.com" <li>
href="mailto:support@myetherwallet.com" target="_blank">Email</a></li> <a
<li><a aria-label="open a github issue" aria-label="email support at myetherwallet.com"
href="https://github.com/kvhnuke/etherwallet/issues" target="_blank">Github href="mailto:support@myetherwallet.com"
Issue</a></li> target="_blank"
</ul> >
</div> Email
</section> </a>
</section> </li>
</div> <li>
</footer> <a
) aria-label="open a github issue"
} href="https://github.com/kvhnuke/etherwallet/issues"
target="_blank"
>
Github
Issue
</a>
</li>
</ul>
</div>
</section>
</section>
</div>
</footer>
);
}
} }

View File

@ -1,162 +1,168 @@
export const DONATION_ADDRESSES_MAP = {
BTC: '1MEWT2SGbqtz6mPCgFcnea8XmWV5Z4Wc6',
ETH: '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8',
REP: '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8'
};
export const languages = [ export const languages = [
{ {
sign: 'en', sign: 'en',
name: 'English' name: 'English'
}, },
{ {
sign: 'de', sign: 'de',
name: 'Deutsch' name: 'Deutsch'
}, },
{ {
sign: 'el', sign: 'el',
name: 'Ελληνικά' name: 'Ελληνικά'
}, },
{ {
sign: 'es', sign: 'es',
name: 'Español' name: 'Español'
}, },
{ {
sign: 'fi', sign: 'fi',
name: 'Suomi' name: 'Suomi'
}, },
{ {
sign: 'fr', sign: 'fr',
name: 'Français' name: 'Français'
}, },
{ {
sign: 'hu', sign: 'hu',
name: 'Magyar' name: 'Magyar'
}, },
{ {
sign: 'id', sign: 'id',
name: 'Indonesian' name: 'Indonesian'
}, },
{ {
sign: 'it', sign: 'it',
name: 'Italiano' name: 'Italiano'
}, },
{ {
sign: 'ja', sign: 'ja',
name: '日本語' name: '日本語'
}, },
{ {
sign: 'nl', sign: 'nl',
name: 'Nederlands' name: 'Nederlands'
}, },
{ {
sign: 'no', sign: 'no',
name: 'Norsk Bokmål' name: 'Norsk Bokmål'
}, },
{ {
sign: 'pl', sign: 'pl',
name: 'Polski' name: 'Polski'
}, },
{ {
sign: 'pt', sign: 'pt',
name: 'Português' name: 'Português'
}, },
{ {
sign: 'ru', sign: 'ru',
name: 'Русский' name: 'Русский'
}, },
{ {
sign: 'ko', sign: 'ko',
name: 'Korean' name: 'Korean'
}, },
// { // {
// 'sign': 'sk', // 'sign': 'sk',
// 'name': 'Slovenčina' // 'name': 'Slovenčina'
// }, // },
// { // {
// 'sign': 'sl', // 'sign': 'sl',
// 'name': 'Slovenščina' // 'name': 'Slovenščina'
// }, // },
// { // {
// 'sign': 'sv', // 'sign': 'sv',
// 'name': 'Svenska' // 'name': 'Svenska'
// }, // },
{ {
sign: 'tr', sign: 'tr',
name: 'Türkçe' name: 'Türkçe'
}, },
{ {
sign: 'vi', sign: 'vi',
name: 'Tiếng Việt' name: 'Tiếng Việt'
}, },
{ {
sign: 'zhcn', sign: 'zhcn',
name: '简体中文' name: '简体中文'
}, },
{ {
sign: 'zhtw', sign: 'zhtw',
name: '繁體中文' name: '繁體中文'
} }
]; ];
export const nodeList = [ export const nodeList = [
{ {
name: 'ETH', name: 'ETH',
blockExplorerTX: 'https://etherscan.io/tx/[[txHash]]', blockExplorerTX: 'https://etherscan.io/tx/[[txHash]]',
blockExplorerAddr: 'https://etherscan.io/address/[[address]]', blockExplorerAddr: 'https://etherscan.io/address/[[address]]',
// 'type': nodes.nodeTypes.ETH, // 'type': nodes.nodeTypes.ETH,
eip155: true, eip155: true,
chainId: 1, chainId: 1,
// 'tokenList': require('./tokens/ethTokens.json'), // 'tokenList': require('./tokens/ethTokens.json'),
// 'abiList': require('./abiDefinitions/ethAbi.json'), // 'abiList': require('./abiDefinitions/ethAbi.json'),
estimateGas: true, estimateGas: true,
service: 'MyEtherWallet' service: 'MyEtherWallet'
// 'lib': new nodes.customNode('https://api.myetherapi.com/eth', '') // 'lib': new nodes.customNode('https://api.myetherapi.com/eth', '')
}, },
{ {
name: 'ETH', name: 'ETH',
blockExplorerTX: 'https://etherscan.io/tx/[[txHash]]', blockExplorerTX: 'https://etherscan.io/tx/[[txHash]]',
blockExplorerAddr: 'https://etherscan.io/address/[[address]]', blockExplorerAddr: 'https://etherscan.io/address/[[address]]',
// 'type': nodes.nodeTypes.ETH, // 'type': nodes.nodeTypes.ETH,
eip155: true, eip155: true,
chainId: 1, chainId: 1,
// 'tokenList': require('./tokens/ethTokens.json'), // 'tokenList': require('./tokens/ethTokens.json'),
// 'abiList': require('./abiDefinitions/ethAbi.json'), // 'abiList': require('./abiDefinitions/ethAbi.json'),
estimateGas: false, estimateGas: false,
service: 'Etherscan.io' service: 'Etherscan.io'
// 'lib': require('./nodeHelpers/etherscan') // 'lib': require('./nodeHelpers/etherscan')
}, },
{ {
name: 'Ropsten', name: 'Ropsten',
// 'type': nodes.nodeTypes.Ropsten, // 'type': nodes.nodeTypes.Ropsten,
blockExplorerTX: 'https://ropsten.etherscan.io/tx/[[txHash]]', blockExplorerTX: 'https://ropsten.etherscan.io/tx/[[txHash]]',
blockExplorerAddr: 'https://ropsten.etherscan.io/address/[[address]]', blockExplorerAddr: 'https://ropsten.etherscan.io/address/[[address]]',
eip155: true, eip155: true,
chainId: 3, chainId: 3,
// 'tokenList': require('./tokens/ropstenTokens.json'), // 'tokenList': require('./tokens/ropstenTokens.json'),
// 'abiList': require('./abiDefinitions/ropstenAbi.json'), // 'abiList': require('./abiDefinitions/ropstenAbi.json'),
estimateGas: false, estimateGas: false,
service: 'MyEtherWallet' service: 'MyEtherWallet'
// 'lib': new nodes.customNode('https://api.myetherapi.com/rop', '') // 'lib': new nodes.customNode('https://api.myetherapi.com/rop', '')
}, },
{ {
name: 'Kovan', name: 'Kovan',
// 'type': nodes.nodeTypes.Kovan, // 'type': nodes.nodeTypes.Kovan,
blockExplorerTX: 'https://kovan.etherscan.io/tx/[[txHash]]', blockExplorerTX: 'https://kovan.etherscan.io/tx/[[txHash]]',
blockExplorerAddr: 'https://kovan.etherscan.io/address/[[address]]', blockExplorerAddr: 'https://kovan.etherscan.io/address/[[address]]',
eip155: true, eip155: true,
chainId: 42, chainId: 42,
// 'tokenList': require('./tokens/kovanTokens.json'), // 'tokenList': require('./tokens/kovanTokens.json'),
// 'abiList': require('./abiDefinitions/kovanAbi.json'), // 'abiList': require('./abiDefinitions/kovanAbi.json'),
estimateGas: false, estimateGas: false,
service: 'Etherscan.io' service: 'Etherscan.io'
// 'lib': require('./nodeHelpers/etherscanKov') // 'lib': require('./nodeHelpers/etherscanKov')
}, },
{ {
name: 'ETC', name: 'ETC',
blockExplorerTX: 'https://gastracker.io/tx/[[txHash]]', blockExplorerTX: 'https://gastracker.io/tx/[[txHash]]',
blockExplorerAddr: 'https://gastracker.io/addr/[[address]]', blockExplorerAddr: 'https://gastracker.io/addr/[[address]]',
// 'type': nodes.nodeTypes.ETC, // 'type': nodes.nodeTypes.ETC,
eip155: true, eip155: true,
chainId: 61, chainId: 61,
// 'tokenList': require('./tokens/etcTokens.json'), // 'tokenList': require('./tokens/etcTokens.json'),
// 'abiList': require('./abiDefinitions/etcAbi.json'), // 'abiList': require('./abiDefinitions/etcAbi.json'),
estimateGas: false, estimateGas: false,
service: 'Epool.io' service: 'Epool.io'
// 'lib': new nodes.customNode('https://mewapi.epool.io', '') // 'lib': new nodes.customNode('https://mewapi.epool.io', '')
} }
]; ];