diff --git a/app/components/modules/uia/AssetEditWithdrawal.jsx b/app/components/modules/uia/AssetEditWithdrawal.jsx index 78a58f2..63355e2 100644 --- a/app/components/modules/uia/AssetEditWithdrawal.jsx +++ b/app/components/modules/uia/AssetEditWithdrawal.jsx @@ -16,6 +16,17 @@ class AssetEditWithdrawal extends React.Component { return handle(e); }; + onPostfixChange = (e, handle, index, values, setFieldValue) => { + if (e.target.value) { + const way = values.withdrawal.ways[index] + if (way && !way.postfix_title) { + setFieldValue('withdrawal.ways[' + index + '].postfix_title', + tt('asset_edit_withdrawal_jsx.way_postfix_title_placeholder')) + } + } + return handle(e) + }; + submit() { this.submitTried = true; }; @@ -100,7 +111,7 @@ class AssetEditWithdrawal extends React.Component { }; render() { - const { name, values, handleChange, } = this.props; + const { name, values, handleChange, setFieldValue, } = this.props; let wayFields = -
-
+
+
-
+
-
+
+
+
+
+
+ +
+
+
+
+ this.onPostfixChange(e, handleChange, index, values, setFieldValue)} + /> arrayHelpers.push({name: '', memo: '', prefix: ''})} + onClick={() => arrayHelpers.push({name: '', memo: '', prefix: '', postfix_title: '', postfix: ''})} > + {tt('asset_edit_withdrawal_jsx.way_add')} @@ -188,16 +226,25 @@ class AssetEditWithdrawal extends React.Component {
-
-
+
+
{tt('asset_edit_withdrawal_jsx.way_name')}
-
+
{tt('asset_edit_withdrawal_jsx.way_prefix')} +
+ {tt('asset_edit_withdrawal_jsx.if_need')} +
-
+
{tt('asset_edit_withdrawal_jsx.way_memo')}
+
+ {tt('asset_edit_withdrawal_jsx.way_postfix')} +
+ {tt('asset_edit_withdrawal_jsx.if_need')} +
+
{wayFields}
diff --git a/app/components/modules/uia/AssetEditWithdrawal.scss b/app/components/modules/uia/AssetEditWithdrawal.scss index 225d493..0e4448f 100644 --- a/app/components/modules/uia/AssetEditWithdrawal.scss +++ b/app/components/modules/uia/AssetEditWithdrawal.scss @@ -2,6 +2,29 @@ .input-group { margin-bottom: 1.25rem; } + .way-row { + padding-left: 0.45rem; + .column { + padding-left: 0.5rem; + padding-right: 0.5rem; + &.postfix-left { + padding-right: 0rem; + input { + font-size: 90%; + } + } + &.postfix-right { + padding-left: 0rem; + } + } + &.header { + font-size: 85%; + .secondary { + font-size: 85%; + padding-bottom: 0.25rem; + } + } + } .add-way { display: block; margin-bottom: 1.25rem; diff --git a/app/components/modules/uia/UpdateAsset.jsx b/app/components/modules/uia/UpdateAsset.jsx index 6b2fd21..25e40c4 100644 --- a/app/components/modules/uia/UpdateAsset.jsx +++ b/app/components/modules/uia/UpdateAsset.jsx @@ -69,7 +69,7 @@ class UpdateAsset extends Component { details: '', }; if (!withdrawal.ways || !withdrawal.ways[0]) - withdrawal.ways = [{ name: '', memo: '', prefix: '', }]; + withdrawal.ways = [{ name: '', memo: '', prefix: '', postfix_title: '', postfix: '' }]; this.setState({ initialValues: { fee_percent, @@ -279,6 +279,7 @@ class UpdateAsset extends Component { ref={this.aewRef} values={values} handleChange={handleChange} + setFieldValue={setFieldValue} />
diff --git a/app/locales/en.json b/app/locales/en.json index 3195e78..72cdcf5 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -724,6 +724,12 @@ "way_memo_placeholder": "USDT-wallet-address", "way_prefix": "Memo prefix: ", "way_prefix_placeholder": "tron:", + "way_postfix": "Memo postfix: ", + "way_postfix_title_placeholder": "whom:", + "way_postfix_placeholder": "your public key", + "way_postfix_hint": "Placeholder, what user should be enter here, e.g. \"your public key\"", + "way_postfix_title_hint": "Title of field, e.g. \"whom:\"", + "if_need": "(if need)", "way_add": "Add another method", "way_name_error": "Specify the name of the network/system, example: USDT (TRC-20), DOGE...", "way_prefix_error": "Do not prepend memo itself with the prefix.", diff --git a/app/locales/ru-RU.json b/app/locales/ru-RU.json index 7310bac..997e669 100644 --- a/app/locales/ru-RU.json +++ b/app/locales/ru-RU.json @@ -1099,8 +1099,14 @@ "way_name_placeholder": "USDT (TRC-20)", "way_memo": "Заметка к переводу: ", "way_memo_placeholder": "адрес-USDT-кошелька", - "way_prefix": "Префикс заметки (если нужен): ", + "way_prefix": "Префикс заметки: ", "way_prefix_placeholder": "tron:", + "way_postfix": "Дополнение к заметке: ", + "way_postfix_title_placeholder": "кому:", + "way_postfix_placeholder": "ваш public key", + "way_postfix_hint": "Пояснение, что должен ввести пользователь в это поле, например \"ваш public key\"", + "way_postfix_title_hint": "Заголовок поля, например \"кому:\"", + "if_need": "(если нужно)", "way_add": "Добавить способ вывода", "way_name_error": "Укажите название сети/системы, например: USDT (TRC-20), AdvCash, QIWI (на телефон).", "way_prefix_error": "Префикс не нужно указывать в самой заметке.",