pbca26
7 years ago
8 changed files with 176 additions and 147 deletions
@ -1,50 +1,43 @@ |
|||
import React from 'react'; |
|||
import { translate } from '../../translate/translate'; |
|||
import mainWindow from '../../util/mainWindow'; |
|||
|
|||
class AddCoinOptionsAC extends React.Component { |
|||
render() { |
|||
const _assetChains = [ |
|||
'bet', |
|||
'bots', |
|||
'ceal', |
|||
'coqui', |
|||
'crypto', |
|||
'hodl', |
|||
'dex', |
|||
'jumblr', |
|||
'kv', |
|||
'mgw', |
|||
//'mvp',
|
|||
'mnz', |
|||
'pangea', |
|||
'revs', |
|||
'mshark', |
|||
'supernet', |
|||
'wlc', |
|||
]; |
|||
let _items = []; |
|||
const addCoinOptionsAC = () => { |
|||
const _assetChains = [ |
|||
'bet', |
|||
'bots', |
|||
'ceal', |
|||
'coqui', |
|||
'crypto', |
|||
'hodl', |
|||
'dex', |
|||
'jumblr', |
|||
'kv', |
|||
'mgw', |
|||
//'mvp',
|
|||
'mnz', |
|||
'pangea', |
|||
'revs', |
|||
'mshark', |
|||
'supernet', |
|||
'wlc', |
|||
]; |
|||
let _items = []; |
|||
|
|||
for (let i = 0; i < _assetChains.length; i++) { |
|||
let availableModes = _assetChains[i] !== 'kv' && _assetChains[i] !== 'mgw' ? 'spv|native' : 'native'; |
|||
for (let i = 0; i < _assetChains.length; i++) { |
|||
let availableModes = _assetChains[i] !== 'kv' && _assetChains[i] !== 'mgw' ? 'spv|native' : 'native'; |
|||
|
|||
if (mainWindow.arch !== 'x64') { |
|||
availableModes = 'spv'; |
|||
} |
|||
|
|||
_items.push( |
|||
<option |
|||
key={ _assetChains[i] } |
|||
value={ `${_assetChains[i].toUpperCase()}|${availableModes}` }>{ translate(`ASSETCHAINS.${_assetChains[i].toUpperCase()}`) }</option> |
|||
); |
|||
if (mainWindow.arch !== 'x64') { |
|||
availableModes = 'spv'; |
|||
} |
|||
|
|||
return ( |
|||
<optgroup label={ translate('ADD_COIN.ASSETCHAINS') }> |
|||
{ _items } |
|||
</optgroup> |
|||
); |
|||
_items.push({ |
|||
label: translate(`ASSETCHAINS.${_assetChains[i].toUpperCase()}`), |
|||
icon: _assetChains[i], |
|||
value: `${_assetChains[i].toUpperCase()}|${availableModes}`, |
|||
}); |
|||
} |
|||
|
|||
return _items; |
|||
} |
|||
|
|||
export default AddCoinOptionsAC; |
|||
export default addCoinOptionsAC; |
|||
|
@ -1,58 +1,51 @@ |
|||
import React from 'react'; |
|||
import { translate } from '../../translate/translate'; |
|||
|
|||
class AddCoinOptionsACFiat extends React.Component { |
|||
render() { |
|||
const _fiat = [ |
|||
'aud', |
|||
'brl', |
|||
'gbp', |
|||
'bgn', |
|||
'cad', |
|||
'hrk', |
|||
'czk', |
|||
'cny', |
|||
'dkk', |
|||
'eur', |
|||
'hkd', |
|||
'huf', |
|||
'inr', |
|||
'idr', |
|||
'ils', |
|||
'jpy', |
|||
'krw', |
|||
'myr', |
|||
'mxn', |
|||
'nzd', |
|||
'nok', |
|||
'php', |
|||
'pln', |
|||
'ron', |
|||
'rub', |
|||
'sgd', |
|||
'zar', |
|||
'sek', |
|||
'chf', |
|||
'thb', |
|||
'try', |
|||
'usd' |
|||
]; |
|||
let _items = []; |
|||
const addCoinOptionsACFiat = () => { |
|||
const _fiat = [ |
|||
'aud', |
|||
'brl', |
|||
'gbp', |
|||
'bgn', |
|||
'cad', |
|||
'hrk', |
|||
'czk', |
|||
'cny', |
|||
'dkk', |
|||
'eur', |
|||
'hkd', |
|||
'huf', |
|||
'inr', |
|||
'idr', |
|||
'ils', |
|||
'jpy', |
|||
'krw', |
|||
'myr', |
|||
'mxn', |
|||
'nzd', |
|||
'nok', |
|||
'php', |
|||
'pln', |
|||
'ron', |
|||
'rub', |
|||
'sgd', |
|||
'zar', |
|||
'sek', |
|||
'chf', |
|||
'thb', |
|||
'try', |
|||
'usd' |
|||
]; |
|||
let _items = []; |
|||
|
|||
for (let i = 0; i < _fiat.length; i++) { |
|||
_items.push( |
|||
<option |
|||
key={ _fiat[i] } |
|||
value={ `${_fiat[i].toUpperCase()}|native` }>{ translate(`FIAT_CURRENCIES.${_fiat[i].toUpperCase()}`) }</option> |
|||
); |
|||
} |
|||
|
|||
return ( |
|||
<optgroup label={ translate('ADD_COIN.FIAT_CURRENCIES') }> |
|||
{ _items } |
|||
</optgroup> |
|||
); |
|||
for (let i = 0; i < _fiat.length; i++) { |
|||
_items.push({ |
|||
label: translate(`FIAT_CURRENCIES.${_fiat[i].toUpperCase()}`), |
|||
icon: _fiat[i], |
|||
value: `${_fiat[i].toUpperCase()}|native`, |
|||
}); |
|||
} |
|||
|
|||
return _items; |
|||
} |
|||
|
|||
export default AddCoinOptionsACFiat; |
|||
export default addCoinOptionsACFiat; |
|||
|
@ -1,24 +1,19 @@ |
|||
import React from 'react'; |
|||
import { translate } from '../../translate/translate'; |
|||
import mainWindow from '../../util/mainWindow'; |
|||
|
|||
class AddCoinOptionsCrypto extends React.Component { |
|||
constructor() { |
|||
super(); |
|||
this.state = { |
|||
}; |
|||
} |
|||
const addCoinOptionsCrypto = () => { |
|||
const availableKMDModes = mainWindow.arch === 'x64' ? 'spv|native' : 'spv'; |
|||
|
|||
render() { |
|||
let availableKMDModes = mainWindow.arch === 'x64' ? 'spv|native' : 'spv'; |
|||
|
|||
return ( |
|||
<optgroup label={ translate('ADD_COIN.CRYPTO_CURRENCIES') }> |
|||
<option value={ `KMD|${availableKMDModes}` }>Komodo (KMD)</option> |
|||
<option value="CHIPS|spv">Chips (CHIPS)</option> |
|||
</optgroup> |
|||
); |
|||
} |
|||
return [{ |
|||
label: 'Komodo (KMD)', |
|||
icon: 'KMD', |
|||
value: `KMD|${availableKMDModes}`, |
|||
}, |
|||
{ |
|||
label: 'Chips (CHIPS)', |
|||
icon: 'CHIPS', |
|||
value: `CHIPS|spv`, |
|||
}]; |
|||
} |
|||
|
|||
export default AddCoinOptionsCrypto; |
|||
export default addCoinOptionsCrypto; |
|||
|
Loading…
Reference in new issue