Commit e2aa0d65 authored by zeroleak's avatar zeroleak
Browse files

use MIXSTARGET_VALUES

parent 124c6e6e
......@@ -2,7 +2,7 @@
import React from 'react';
import { Button } from 'react-bootstrap';
import * as Icon from 'react-feather';
import utils from '../../services/utils';
import utils, { MIXSTARGET_VALUES } from '../../services/utils';
import mixService from '../../services/mixService';
import AbstractModal from './AbstractModal';
import poolsService from '../../services/poolsService';
......@@ -129,12 +129,11 @@ export default class Tx0Modal extends AbstractModal {
Mixs target: (editable later)
<select className="form-control col-sm-2" onChange={this.handleChangeMixsTargetTx0} defaultValue={this.state.mixsTarget}>
<option value={1}>1</option>
<option value={2}>2</option>
<option value={3}>3</option>
<option value={5}>5</option>
<option value={10}>10</option>
<option value={0}></option>
{MIXSTARGET_VALUES.map(value => {
value = parseInt(value)
const label = utils.mixsTargetLabel(value)
return <option value={value}>{label}</option>
})}
</select><br/>
{this.state.tx0Preview && <div>
......
......@@ -7,19 +7,17 @@
import React from 'react';
import { Dropdown, DropdownButton } from 'react-bootstrap';
import mixService from '../../services/mixService';
import { MIXSTARGET_UNLIMITED } from '../../services/utils';
import utils from '../../services/utils';
import utils, { MIXSTARGET_VALUES } from '../../services/utils';
/* eslint-disable react/prefer-stateless-function */
class UtxoMixsTargetSelector extends React.PureComponent {
render () {
const utxo = this.props.utxo
const targets = [1, 2, 3, 5, 10, 25, 50, 100, MIXSTARGET_UNLIMITED]
return (
<DropdownButton size='sm' variant="default" title={utxo.mixsDone+' / '+utils.mixsTargetLabel(utxo.mixsTargetOrDefault)} className='utxoMixsTargetSelector'>
{targets.map(value => {
{MIXSTARGET_VALUES.map(value => {
value = parseInt(value)
const label = utils.mixsTargetLabel(value)
return <Dropdown.Item key={value} active={value === utxo.mixsTarget} onClick={() => mixService.setMixsTarget(utxo, value)}>{label}</Dropdown.Item>
......
......@@ -8,7 +8,7 @@ export const API_MODES = {
LOCAL: 'LOCAL',
QA: 'QA'
}
const DL_PATH_LOCAL = '/zl/workspaces/whirlpool/whirlpool-client-cli4/target/'
const DL_PATH_LOCAL = '/zl/workspaces/whirlpool/whirlpool-client-cli/target/'
export class CliApiService {
constructor (apiVersion) {
......
......@@ -8,6 +8,7 @@ const AMOUNT_PRECISION = 4
const BTC_TO_SAT = 100000000
export const TX0_MIN_CONFIRMATIONS = 0
export const MIXSTARGET_UNLIMITED = 0
export const MIXSTARGET_VALUES = [1, 2, 3, 5, 10, 25, 50, 100, MIXSTARGET_UNLIMITED]
export const DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
export const WHIRLPOOL_ACCOUNTS = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment