diff --git a/src/Translation/locales/en.json b/src/Translation/locales/en.json index 1224ba78d..6d5d2bfe3 100644 --- a/src/Translation/locales/en.json +++ b/src/Translation/locales/en.json @@ -32,6 +32,7 @@ "insufficient_funds": "The bidder has insufficient funds to pay for the bid", "list_asset": "Place a bid for the {asset_name}", + "not_enough": "You don't have enough MANA in your account", "please_authorize": "You need to go to {settings_link} and authorize the Bid contract to use MANA on your behalf before you can place a bid.", "price_placeholder": "Price in MANA for this {asset_name}", diff --git a/src/Translation/locales/es.json b/src/Translation/locales/es.json index d13a6e108..474de2807 100644 --- a/src/Translation/locales/es.json +++ b/src/Translation/locales/es.json @@ -33,6 +33,7 @@ "insufficient_funds": "El ofertante no tiene fondos suficientes para pagar la oferta.", "list_asset": "Haz una oferta por el {asset_name}", + "not_enough": "No tienes suficiente MANA en tu cuenta", "please_authorize": "Debe ir a {settings_link} y autorizar el contrato de la Oferta para utilizar MANA en su nombre antes de poder realizar una oferta.", "price_placeholder": "Precio en MANA para este {asset_name}.", diff --git a/src/Translation/locales/fr.json b/src/Translation/locales/fr.json index 9aa6f71e9..0c08f4ed8 100644 --- a/src/Translation/locales/fr.json +++ b/src/Translation/locales/fr.json @@ -35,6 +35,7 @@ "insufficient_funds": "Le soumissionnaire n'a pas suffisamment de fonds pour payer pour la soumission", "list_asset": "Placer une offre pour le {asset_name}", + "not_enough": "Vous n'avez pas assez de MANA dans votre compte", "please_authorize": "Vous devez vous rendre sur {settings_link} et autoriser le contrat d’offre à utiliser MANA en votre nom avant de pouvoir enchérir.", "price_placeholder": "Prix ​​en MANA pour ce {asset_name}", diff --git a/src/Translation/locales/ja.json b/src/Translation/locales/ja.json index 8a1c000d6..1bbc6a672 100644 --- a/src/Translation/locales/ja.json +++ b/src/Translation/locales/ja.json @@ -31,6 +31,7 @@ "expiration_placeholder": "この出版物の有効期限", "insufficient_funds": "入札者が入札のために支払うには資金が足りない", "list_asset": "{asset_name}に入札する", + "not_enough": "あなたのアカウントに十分なMANAがありません", "please_authorize": "あなたが入札をすることができる前にあなたは{settings_link}に行き、あなたに代わってMANAを使うために入札契約を承認する必要があります。", "price_placeholder": "この{asset_name}のMANAでの価格", diff --git a/src/Translation/locales/ko.json b/src/Translation/locales/ko.json index 632b99e85..bb3b537ab 100644 --- a/src/Translation/locales/ko.json +++ b/src/Translation/locales/ko.json @@ -31,6 +31,7 @@ "expiration_placeholder": "이 발행물의 만료일", "insufficient_funds": "입찰자가 입찰 비용을 지불하기에 부족합니다.", "list_asset": "{asset_name}에 입찰하기", + "not_enough": "계정에 MANA가 충분하지 않습니다.", "please_authorize": "{settings_link}에 가서 입찰을하기 전에 MANA를 사용하도록 입찰 계약서를 승인해야합니다.", "price_placeholder": "이 {asset_name}에 대한 MANA의 가격", diff --git a/src/Translation/locales/zh.json b/src/Translation/locales/zh.json index b73e97c55..4c8e92e31 100644 --- a/src/Translation/locales/zh.json +++ b/src/Translation/locales/zh.json @@ -29,6 +29,7 @@ "expiration_placeholder": "本出版物的截止日期", "insufficient_funds": "投标人没有足够的资金来支付投标费用", "list_asset": "对{asset_name}进行出价", + "not_enough": "您的帐户中没有足够的MANA", "please_authorize": "您需要转到{settings_link}并授权投标合同代表您使用MANA,然后才能出价。", "price_placeholder": "这个{asset_name}的价格在MANA", diff --git a/webapp/src/components/AcceptBidAssetPage/AcceptBidAssetPage.js b/webapp/src/components/AcceptBidAssetPage/AcceptBidAssetPage.js index 4a2ce7926..0e2e162df 100644 --- a/webapp/src/components/AcceptBidAssetPage/AcceptBidAssetPage.js +++ b/webapp/src/components/AcceptBidAssetPage/AcceptBidAssetPage.js @@ -74,14 +74,14 @@ export default class AcceptBidAssetPage extends React.PureComponent { const { bidderHasBalance } = this.state const { assetType, bid } = this.props - const bidIsOpen = isOpen(bid) + const isBidOpen = isOpen(bid) switch (assetType) { case ASSET_TYPES.parcel: return ( @@ -90,7 +90,7 @@ export default class AcceptBidAssetPage extends React.PureComponent { return ( diff --git a/webapp/src/components/BidAssetPage/BidAssetForm.css b/webapp/src/components/BidAssetPage/BidAssetForm.css index 881317c1e..d2e0f276f 100644 --- a/webapp/src/components/BidAssetPage/BidAssetForm.css +++ b/webapp/src/components/BidAssetPage/BidAssetForm.css @@ -1,3 +1,8 @@ .BidForm.ui.form .field>label { text-transform: capitalize; +} + +.BidForm.ui.form .field>label.warning{ + color: var(--error); + text-transform: none; } \ No newline at end of file diff --git a/webapp/src/components/BidAssetPage/BidAssetForm.js b/webapp/src/components/BidAssetPage/BidAssetForm.js index 71ecf20b3..94cd9a7ff 100644 --- a/webapp/src/components/BidAssetPage/BidAssetForm.js +++ b/webapp/src/components/BidAssetPage/BidAssetForm.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import addDays from 'date-fns/add_days' import dateFnsFormat from 'date-fns/format' import differenceInDays from 'date-fns/difference_in_days' -import { Form, Button, Input, Message } from 'semantic-ui-react' +import { Form, Button, Input, Message, Icon } from 'semantic-ui-react' import { t } from '@dapps/modules/translation/utils' import { assetType, bidType } from 'components/types' @@ -34,7 +34,8 @@ export default class BidAssetForm extends React.PureComponent { isTxIdle: PropTypes.bool, isDisabled: PropTypes.bool, onBid: PropTypes.func.isRequired, - onCancel: PropTypes.func.isRequired + onCancel: PropTypes.func.isRequired, + balance: PropTypes.number.isRequired } constructor(props) { @@ -55,8 +56,8 @@ export default class BidAssetForm extends React.PureComponent { const price = sanitizePrice(e.currentTarget.value) this.setState({ - price, - formErrors: [] + formErrors: [], + price }) } @@ -136,9 +137,11 @@ export default class BidAssetForm extends React.PureComponent { } render() { - const { isTxIdle, assetName, isDisabled, onCancel } = this.props + const { isTxIdle, assetName, isDisabled, onCancel, balance } = this.props const { price, expiresAt, formErrors } = this.state + const canBid = price <= balance + return (
+ {price > balance ? ( + + ) : null} @@ -180,7 +189,7 @@ export default class BidAssetForm extends React.PureComponent { diff --git a/webapp/src/components/BidAssetPage/BidEstatePage/BidEstatePage.js b/webapp/src/components/BidAssetPage/BidEstatePage/BidEstatePage.js index 8d0741cd2..fda93db2d 100644 --- a/webapp/src/components/BidAssetPage/BidEstatePage/BidEstatePage.js +++ b/webapp/src/components/BidAssetPage/BidEstatePage/BidEstatePage.js @@ -7,7 +7,7 @@ import { t, T } from '@dapps/modules/translation/utils' import { locations } from 'locations' import { isOpen } from 'shared/listing' import BidAssetForm from '../BidAssetForm' -import { authorizationType, bidType } from 'components/types' +import { authorizationType, bidType, walletType } from 'components/types' import Estate from 'components/Estate' import EstateName from 'components/EstateName' import TxStatus from 'components/TxStatus' @@ -22,13 +22,14 @@ export default class BidEstatePage extends React.PureComponent { isTxIdle: PropTypes.bool.isRequired, onBid: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, - isAllowed: PropTypes.bool.isRequired + isAllowed: PropTypes.bool.isRequired, + wallet: walletType } render() { - const { id, bid, isTxIdle, onBid, onCancel, isAllowed } = this.props + const { id, bid, isTxIdle, onBid, onCancel, isAllowed, wallet } = this.props - const bidIsOpen = isOpen(bid) + const isBidOpen = isOpen(bid) return ( @@ -59,7 +60,7 @@ export default class BidEstatePage extends React.PureComponent { title={ @@ -63,7 +64,7 @@ export default class BidParcelPage extends React.PureComponent { title={