1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Replaces the coinbase link in the deposit modal with one for wyre (#6302)

This commit is contained in:
Dan J Miller 2019-03-22 12:32:07 -02:30 committed by GitHub
parent 174ec2d596
commit 4ff9126ff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 16 deletions

View File

@ -191,6 +191,12 @@
"buyCoinbaseExplainer": {
"message": "Coinbase is the worlds most popular way to buy and sell Bitcoin, Ethereum, and Litecoin."
},
"buyWithWyre": {
"message": "Buy ETH with Wyre"
},
"buyWithWyreDescription": {
"message": "Wyre lets you use aa credit card to deposit ETH right in to your MetaMask account. From the Airswap website, click \"Use Fiat\" in the top-right corner. You can also use Airswap to get started with ERC 20 tokens!"
},
"bytes": {
"message": "Bytes"
},
@ -296,6 +302,9 @@
"continueToCoinbase": {
"message": "Continue to Coinbase"
},
"continueToWyre": {
"message": "Continue to Wyre"
},
"contractDeployment": {
"message": "Contract Deployment"
},

9
app/images/wyre.svg Normal file
View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="24" viewBox="0 0 72 24">
<g fill="#000000" fill-rule="evenodd">
<path d="M40.2451269,20.4956914 C42.4518577,20.8032343 43.7956269,20.4027771 44.8365115,19.3728343 C45.49005,18.7265486 45.9867808,17.96952 46.4253577,17.1740914 C48.2011269,13.9553486 52.4737038,6.17900571 52.4737038,6.17900571 L49.3957038,6.17900571 L46.1955115,12.5492914 L45.1968577,6.17900571 L41.9257038,6.17900571 L41.9257038,6.32712 C41.9257038,6.32712 43.03305,12.15912 43.6014346,15.1478057 C43.6862423,15.5931771 43.7738192,16.7393486 42.9603577,17.4806057 C42.5051654,17.89512 41.8478192,18.2396914 40.71555,18.0562629 L40.2451269,20.4956914 Z"/>
<polygon points="37.793 6.179 34.817 12.868 34.737 12.861 34.334 6.345 31.093 6.345 27.934 12.869 27.853 12.842 27.718 6.179 24.617 6.179 25.234 16.864 28.59 16.864 31.842 9.892 31.918 9.905 32.434 16.864 35.812 16.864 40.698 6.179"/>
<path d="M55.7303192 16.8643543L52.4737038 16.8643543C53.1992423 13.2612686 53.8922423 9.77921143 54.6174346 6.17886857L57.1422808 6.17886857 57.1422808 8.14481143C57.4801269 7.33258286 57.9412038 6.57624 58.7235115 6.24435429 59.4909346 5.91864 60.6772038 5.93578286 61.8866654 6.30366857 61.4103577 7.21738286 61.0472423 8.03029714 60.5314731 9.01944 60.0662423 8.92824 59.6477423 8.81166857 59.2216269 8.76984 58.2645115 8.67555429 57.5694346 9.05372571 57.2426654 9.95269714 57.01455 10.5804686 56.8726269 11.2452686 56.7348577 11.9011543 56.3893962 13.5444686 56.0685115 15.1918971 55.7303192 16.8643543M66.1421769 8.72009143C66.6077538 8.15952 67.4461385 7.84957714 68.0685231 8.04260571 68.8276385 8.27814857 69.0768692 9.11163429 68.5375615 9.69346286 68.3544462 9.89094857 68.0989846 10.0544914 67.8445615 10.14912 67.0612154 10.4405486 66.2505231 10.4316343 65.3976 10.2862629 65.5419462 9.66672 65.7704077 9.16752 66.1421769 8.72009143L66.1421769 8.72009143zM70.3102154 14.2082057C70.3102154 14.2082057 70.2828692 14.2078629 70.2011769 14.2078629 68.9543308 14.6816914 67.5707538 14.8058057 66.6171 14.5380343 65.5634077 14.2421486 64.9555615 13.33392 65.1469846 12.3080914 68.2872923 12.5696914 69.6203308 11.9775771 70.3358308 11.5538057 72.2742923 10.4055771 72.7672154 7.33220571 70.2378692 6.42226286 68.0155615 5.62272 64.9199077 6.00294857 63.4574077 7.75769143 62.1247154 9.35677714 61.7335615 11.1152914 61.9377923 13.0726629 62.0911385 14.5452343 63.1105615 16.6562057 66.4422923 16.9856914 68.4565615 17.1848914 69.7459846 16.67232 69.8397923 16.63392L70.3102154 14.2082057zM4.97682692 23.9956457L12.3824423 23.9956457C13.8428654 23.9956457 15.15825 23.1210171 15.7114038 21.7825029L19.7060192 12.11736 15.2226346 17.7649029C14.5431346 18.6614743 13.5147115 19.2443314 12.30525 19.2443314L6.94055769 19.2443314 4.97682692 23.9956457z"/>
<path d="M2.52183462,18.0546514 L9.92745,18.0546514 C11.3878731,18.0546514 12.7032577,17.1800229 13.2564115,15.8415086 L17.2513731,6.17670857 L12.7676423,11.8239086 C12.0881423,12.72048 11.0597192,13.3033371 9.85025769,13.3033371 L4.48556538,13.3033371 L2.52183462,18.0546514 Z"/>
<path d="M7.39111154,0.22872 L14.7967269,0.22872 L10.8014192,9.89489143 C10.2482654,11.2334057 8.93288077,12.1080343 7.47245769,12.1080343 L0.0668423077,12.1080343 L4.06215,2.44186286 C4.61530385,1.10334857 5.93068846,0.22872 7.39111154,0.22872"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -15,7 +15,7 @@ function getBuyEthUrl ({ network, amount, address }) {
let url
switch (network) {
case '1':
url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`
url = `https://dash.sendwyre.com/sign-up`
break
case '3':

View File

@ -18,14 +18,9 @@ describe('', function () {
}
it('returns coinbase url with amount and address for network 1', function () {
const coinbaseUrl = getBuyEthUrl(mainnet)
const coinbase = coinbaseUrl.match(/(https:\/\/buy.coinbase.com)/)
const amount = coinbaseUrl.match(/(amount)\D\d/)
const address = coinbaseUrl.match(/(address)(.*)(?=&)/)
const wyreUrl = getBuyEthUrl(mainnet)
assert.equal(coinbase[0], 'https://buy.coinbase.com')
assert.equal(amount[0], 'amount=5')
assert.equal(address[0], 'address=0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
assert.equal(wyreUrl, 'https://dash.sendwyre.com/sign-up')
})

View File

@ -11,8 +11,8 @@ import Button from '../../ui/button'
let DIRECT_DEPOSIT_ROW_TITLE
let DIRECT_DEPOSIT_ROW_TEXT
let COINBASE_ROW_TITLE
let COINBASE_ROW_TEXT
let WYRE_ROW_TITLE
let WYRE_ROW_TEXT
let SHAPESHIFT_ROW_TITLE
let SHAPESHIFT_ROW_TEXT
let FAUCET_ROW_TITLE
@ -49,8 +49,8 @@ function DepositEtherModal (props, context) {
// need to set after i18n locale has loaded
DIRECT_DEPOSIT_ROW_TITLE = context.t('directDepositEther')
DIRECT_DEPOSIT_ROW_TEXT = context.t('directDepositEtherExplainer')
COINBASE_ROW_TITLE = context.t('buyCoinbase')
COINBASE_ROW_TEXT = context.t('buyCoinbaseExplainer')
WYRE_ROW_TITLE = context.t('buyWithWyre')
WYRE_ROW_TEXT = context.t('buyWithWyreDescription')
SHAPESHIFT_ROW_TITLE = context.t('depositShapeShift')
SHAPESHIFT_ROW_TEXT = context.t('depositShapeShiftExplainer')
FAUCET_ROW_TITLE = context.t('testFaucet')
@ -176,13 +176,13 @@ DepositEtherModal.prototype.render = function () {
this.renderRow({
logo: h('div.deposit-ether-modal__logo', {
style: {
backgroundImage: 'url(\'./images/coinbase logo.png\')',
backgroundImage: 'url(\'./images/wyre.svg\')',
height: '40px',
},
}),
title: COINBASE_ROW_TITLE,
text: COINBASE_ROW_TEXT,
buttonLabel: this.context.t('continueToCoinbase'),
title: WYRE_ROW_TITLE,
text: WYRE_ROW_TEXT,
buttonLabel: this.context.t('continueToWyre'),
onButtonClick: () => toCoinbase(address),
hide: isTestNetwork || buyingWithShapeshift,
}),