augur-ui-react-components
Advanced tools
Comparing version 3.2.4 to 3.2.5
{ | ||
"name": "augur-ui-react-components", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"description": "Augur UI React Components", | ||
@@ -5,0 +5,0 @@ "author": "Augur Project", |
@@ -104,2 +104,3 @@ import React from 'react'; | ||
isTradeCommitLocked={p.tradeCommitLock.isLocked} | ||
/> | ||
@@ -142,2 +143,3 @@ ); | ||
onChangeSort={p.searchSort.onChangeSort} | ||
loginAccount={p.loginAccount} | ||
/> | ||
@@ -144,0 +146,0 @@ ); |
@@ -118,3 +118,3 @@ import React, { PropTypes, Component } from 'react'; | ||
<span> | ||
{p.account.id} | ||
{p.account.id && p.account.id.replace('0x', '')} | ||
</span> | ||
@@ -121,0 +121,0 @@ </td> |
@@ -8,3 +8,4 @@ import React, { Component, PropTypes } from 'react'; | ||
target: PropTypes.string, | ||
onClick: PropTypes.func | ||
onClick: PropTypes.func, | ||
disabled: PropTypes.bool | ||
}; | ||
@@ -27,3 +28,3 @@ | ||
e.preventDefault(); | ||
if (this.props.onClick) { | ||
if (this.props.onClick && !this.props.disabled) { | ||
this.props.onClick(this.props.href); | ||
@@ -30,0 +31,0 @@ } |
@@ -28,3 +28,3 @@ /* | ||
Because Augur is a <b>completely decentralized</b> system, if you lose your login credentials it | ||
is impossible to recover them. Please <a className="link" href="http://blog.augur.net/faq/how-do-i-savebackup-my-wallet/" target="_blank">take | ||
is impossible to recover them. Please <a className="link" href="http://blog.augur.net/faq/how-do-i-savebackup-my-wallet/">take | ||
appropriate measures</a> to protect the safety of your password, and create a way to | ||
@@ -45,3 +45,3 @@ recover your credentials if you forget them. | ||
users visit the site at least every 2 days to maintain your REP and simulate “real money” trading, | ||
resolution, and reporting conditions. Learn <a className="link" href="https://www.youtube.com/watch?v=sCms-snzHk4" target="_blank">how Augur's Reputation tokens | ||
resolution, and reporting conditions. Learn <a className="link" href="https://www.youtube.com/watch?v=sCms-snzHk4">how Augur's Reputation tokens | ||
work</a>. | ||
@@ -48,0 +48,0 @@ </li> |
@@ -13,2 +13,3 @@ import React, { Component, PropTypes } from 'react'; | ||
createMarketLink: PropTypes.object, | ||
loginAccount: PropTypes.object, | ||
markets: PropTypes.array, | ||
@@ -33,2 +34,3 @@ favoriteMarkets: PropTypes.array, | ||
const p = this.props; | ||
return ( | ||
@@ -35,0 +37,0 @@ <div className="page markets"> |
@@ -10,3 +10,3 @@ import React from 'react'; | ||
<div className="component-header"> | ||
<Link className="button make" {...p.createMarketLink}> | ||
<Link className="button make" {...p.createMarketLink} disabled={!p.loginAccount.id}> | ||
Make a Market | ||
@@ -13,0 +13,0 @@ </Link> |
@@ -11,3 +11,3 @@ import React from 'react'; | ||
<nav className="site-nav"> | ||
<Link className={classnames('site-nav-link', 'augur', { active: p.activePage === MARKETS })} {...p.marketsLink}>augur</Link> | ||
<Link className={classnames('site-nav-link', 'augur')} {...p.marketsLink}>augur</Link> | ||
@@ -14,0 +14,0 @@ <span className="spacer"> </span> |
@@ -53,3 +53,6 @@ import React from 'react'; | ||
type="number" | ||
step="0.1" | ||
value={p.trade.numShares} | ||
title={p.trade.maxNumShares && `${p.trade.maxNumShares.minimized} shares max at this price`} | ||
min="0" max={p.trade.maxNumShares} step="any" | ||
onChange={(value) => p.trade.updateTradeOrder(value, undefined, p.trade.side)} | ||
@@ -63,3 +66,5 @@ onClick={(e) => { e.stopPropagation(); p.updateSelectedOutcome(p.id); }} | ||
type="number" | ||
step="0.1" | ||
value={p.trade.limitPrice} | ||
step="any" | ||
onChange={(value) => p.trade.updateTradeOrder(undefined, value, p.trade.side)} | ||
@@ -66,0 +71,0 @@ onClick={(e) => { e.stopPropagation(); p.updateSelectedOutcome(p.id); }} |
import React from 'react'; | ||
import Link from '../../link/components/link'; | ||
import classnames from 'classnames'; | ||
import { CREATE_MARKET, BUY, SELL, BID, ASK, SHORT_SELL, SHORT_ASK, COMMIT_REPORT, REVEAL_REPORT, GENERATE_ORDER_BOOK, CANCEL_ORDER, SELL_COMPLETE_SETS } from '../../transactions/constants/types'; | ||
import { CREATE_MARKET, BUY, SELL, BID, ASK, SHORT_SELL, SHORT_ASK, COMMIT_REPORT, GENERATE_ORDER_BOOK, CANCEL_ORDER, SELL_COMPLETE_SETS } from '../../transactions/constants/types'; | ||
import { LOGIN, FUND_ACCOUNT } from '../../auth/constants/auth-types'; | ||
@@ -62,3 +62,3 @@ import { SCALAR } from '../../markets/constants/market-types'; | ||
<span className="action">{nodes.action}</span> | ||
<ValueDenomination className="shares" {...p.numShares} /> | ||
<ValueDenomination className="shares" {...p.data.numShares} /> | ||
{p.data.marketType !== SCALAR && | ||
@@ -70,5 +70,5 @@ <span> | ||
<span className="at">@</span> | ||
<ValueDenomination className="noFeePrice" {...p.noFeePrice} postfix="(average)" /> | ||
<ValueDenomination className="noFeePrice" {...p.data.noFeePrice} postfix="(average)" /> | ||
<br className="hide-in-tx-display" /> | ||
<ValueDenomination className="avgPrice" {...p.avgPrice} prefix="including trading fees:" postfix="/ share" /> | ||
<ValueDenomination className="avgPrice" {...p.data.avgPrice} prefix="including trading fees:" postfix="/ share" /> | ||
<br /> | ||
@@ -90,3 +90,3 @@ {marketDescription()} | ||
<span className="action">{nodes.action}</span> | ||
<ValueDenomination className="shares" {...p.numShares} postfix="of each outcome" /> | ||
<ValueDenomination className="shares" {...p.data.numShares} postfix="of each outcome" /> | ||
<br /> | ||
@@ -131,16 +131,5 @@ {marketDescription()} | ||
break; | ||
case COMMIT_REPORT: | ||
case REVEAL_REPORT: | ||
switch (p.type) { | ||
case REVEAL_REPORT: | ||
nodes.action = 'Reveal report'; | ||
break; | ||
case COMMIT_REPORT: | ||
nodes.action = 'Commit report'; | ||
break; | ||
default: | ||
break; | ||
} | ||
if (p.data.isScalar || p.data.market.type === SCALAR) { | ||
case COMMIT_REPORT: { | ||
nodes.action = 'Commit report'; | ||
if (p.data.market.type === SCALAR) { | ||
nodes.description = ( | ||
@@ -179,3 +168,3 @@ <span className="description"> | ||
break; | ||
} | ||
case GENERATE_ORDER_BOOK: | ||
@@ -228,13 +217,16 @@ nodes.action = 'Generate order book'; | ||
<span className="value-changes"> | ||
{!!p.tradingFees && p.tradingFees.value !== null && p.tradingFees.value !== undefined && | ||
<ValueDenomination className="value-change tradingFees" {...p.tradingFees} prefix="trading fees:" /> | ||
{!!p.data && !!p.data.tradingFees && p.data.tradingFees.value !== null && p.data.tradingFees.value !== undefined && | ||
<ValueDenomination className="value-change tradingFees" {...p.data.tradingFees} prefix="trading fees:" /> | ||
} | ||
<span className="spacer"> </span> | ||
{!!p.feePercent && p.feePercent.value !== null && p.feePercent !== undefined && | ||
<ValueDenomination className="value-change feePercent" {...p.feePercent} prefix="[" postfix="]" /> | ||
{!!p.data && !!p.data.feePercent && p.data.feePercent.value !== null && p.data.feePercent !== undefined && | ||
<ValueDenomination className="value-change feePercent" {...p.data.feePercent} prefix="[" postfix="]" /> | ||
} | ||
<br /> | ||
{!!p.gasFees && !!p.gasFees.value && | ||
<ValueDenomination className="value-change gasFees" {...p.gasFees} prefix="estimated gas cost:" /> | ||
{!!p.data && !!p.data.gasFees && !!p.data.gasFees.value && | ||
<ValueDenomination className="value-change gasFees" {...p.data.gasFees} prefix="estimated gas cost:" /> | ||
} | ||
{!!p.ether && !!p.ether.value && | ||
<ValueDenomination className="value-change ether" {...p.ether} prefix="total:" /> | ||
} | ||
</span> | ||
@@ -247,126 +239,8 @@ | ||
<br /> | ||
{!!p.tradingFees && p.tradingFees.value !== null && p.tradingFees.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="tradingFees-message" | ||
{...p.tradingFees} | ||
prefix="trading fees:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.freeze && | ||
<span className="freeze-message"> | ||
{p.freeze.noFeeCost && | ||
<ValueDenomination | ||
className="freeze-noFeeCost-message" | ||
{...p.freeze.noFeeCost} | ||
prefix={p.freeze.verb} | ||
postfix="+ " | ||
/> | ||
} | ||
<ValueDenomination | ||
className="freeze-tradingFees-message" | ||
{...p.freeze.tradingFees} | ||
prefix={!p.freeze.noFeeCost && p.freeze.verb} | ||
postfix="in potential trading fees" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.totalCost && p.totalCost.value !== null && p.totalCost.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="totalCost-message" | ||
{...p.totalCost} | ||
prefix="total cost:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.totalReturn && p.totalReturn.value !== null && p.totalReturn.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="totalReturn-message" | ||
{...p.totalReturn} | ||
prefix="total return:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.gasFees && p.gasFees.value !== null && p.gasFees.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="gasFees-message" | ||
{...p.gasFees} | ||
prefix="gas cost:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
<span className="status">{p.status}</span> | ||
</div> | ||
</Link> : | ||
<div className="status-and-message"> | ||
</Link> | ||
: <div className="status-and-message"> | ||
<span className="message" dangerouslySetInnerHTML={liveDangerously(p.message)} /> | ||
<br /> | ||
{!!p.tradingFees && p.tradingFees.value !== null && p.tradingFees.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="tradingFees-message" | ||
{...p.tradingFees} | ||
prefix="trading fees:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.freeze && | ||
<span className="freeze-message"> | ||
{p.freeze.noFeeCost && | ||
<ValueDenomination | ||
className="freeze-noFeeCost-message" | ||
{...p.freeze.noFeeCost} | ||
prefix={p.freeze.verb} | ||
postfix="+" | ||
/> | ||
} | ||
<ValueDenomination | ||
className="freeze-tradingFees-message" | ||
{...p.freeze.tradingFees} | ||
prefix={!p.freeze.noFeeCost && p.freeze.verb} | ||
postfix="in potential trading fees" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.totalCost && p.totalCost.value !== null && p.totalCost.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="totalCost-message" | ||
{...p.totalCost} | ||
prefix="total cost:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.totalReturn && p.totalReturn.value !== null && p.totalReturn.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="totalReturn-message" | ||
{...p.totalReturn} | ||
prefix="total return:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
{!!p.gasFees && p.gasFees.value !== null && p.gasFees.value !== undefined && | ||
<span> | ||
<ValueDenomination | ||
className="gasFees-message" | ||
{...p.gasFees} | ||
prefix="gas cost:" | ||
/> | ||
<br /> | ||
</span> | ||
} | ||
<span className="status">{p.status}</span> | ||
@@ -386,9 +260,5 @@ </div> | ||
shares: React.PropTypes.object, | ||
ether: React.PropTypes.object, | ||
gas: React.PropTypes.object, | ||
hash: React.PropTypes.string, | ||
freeze: React.PropTypes.object, | ||
gasFees: React.PropTypes.object, | ||
tradingFees: React.PropTypes.object, | ||
totalCost: React.PropTypes.object, | ||
totalReturn: React.PropTypes.object, | ||
timestamp: React.PropTypes.object | ||
@@ -395,0 +265,0 @@ }; |
@@ -6,3 +6,3 @@ import { makeNumber } from '../utils/make-number'; | ||
id: '0x45a153fdd97836c2b349a5f53970dc44b0ef1efa', | ||
prettyAddress: '0x45...1efa', | ||
prettyAddress: '45a1...1efa', | ||
localNode: false, | ||
@@ -9,0 +9,0 @@ loginID: 'testID123ASDW3N193NF7V123ADW25579130239SE1235189ADJWKRUY8123AOUELOREMIPSUMDOLORSITAMETCONSECTETURADIPISICINGELITSEDDOEIUSMODTEMPORINCIDIDUNTUTLABOREETDOLOREMAGNAALIQUAUTENIMADMINIMVENIAMQUISNOSTRUDEXERCITATIONULLAMCOLABORISNISIUTALIQUIPEXEACOMMODOCONSEQUATDUISAUTEIRUREDOLORINREPREHENDERITINVOLUPTATEVELITESSECILLUMDOLOREEUFUGIATNULLAPARIATUREXCEPTEURSINTOCCAECATCUPIDATATNONPROIDENTSUNTINCULPAQUIOFFICIADESERUNTMOLLITANIMIDESTLABORUM', |
@@ -291,2 +291,3 @@ import { makeNumber } from '../utils/make-number'; | ||
outcome.trade.limitPrice = limitPrice; | ||
outcome.trade.maxNumShares = makeNumber(Math.round(10 / limitPrice) * 1000); | ||
} | ||
@@ -293,0 +294,0 @@ if (typeof side !== 'undefined') { |
@@ -13,3 +13,3 @@ export function makeNumber(num, denomination, omitSign, noRandom) { | ||
rounded: Math.round(rndNum).toFixed(2), | ||
minimized: rndNum.toFixed(2), | ||
minimized: rndNum.toFixed(0), | ||
denomination: denomination || '' | ||
@@ -16,0 +16,0 @@ }; |
@@ -169,2 +169,7 @@ import {assert} from 'chai'; | ||
it(`market.outcomes[${i}].trade.maxNumShares`, () => { | ||
assert.isDefined(trade.maxNumShares); | ||
assert.isNumber(trade.maxNumShares); | ||
}); | ||
it(`market.outcomes[${i}].trade.limitPrice`, () => { | ||
@@ -171,0 +176,0 @@ assert.isDefined(trade.limitPrice); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1996893
37866