updated transaction screen texts and limits

This commit is contained in:
noumantahir 2023-01-05 19:08:55 +05:00
parent 1f9c3f70cb
commit 6c660e7217
3 changed files with 19 additions and 7 deletions

View File

@ -23,6 +23,7 @@ export interface TransferAmountInputSectionProps {
selectedAccount: any;
fundType: any;
currentAccountName: string;
disableMinimum?: boolean
}
const TransferAmountInputSection = ({
@ -37,6 +38,7 @@ const TransferAmountInputSection = ({
setAmount,
transferType,
fundType,
disableMinimum
}) => {
const intl = useIntl();
@ -88,13 +90,15 @@ const TransferAmountInputSection = ({
const _renderDescription = (text) => <Text style={styles.description}>{text}</Text>;
const _renderCenterDescription = (text) => <Text style={styles.centerDescription}>{text}</Text>;
const amountLimitText = disableMinimum ? '' : intl.formatMessage({id:"transfer.amount_select_desc_limit"});
return (
<View style={styles.stepTwoContainer}>
<Text style={styles.sectionHeading}>
{intl.formatMessage({ id: 'transfer.amount_select_title' })}
</Text>
<Text style={styles.sectionSubheading}>
{intl.formatMessage({ id: 'transfer.amount_select_description' })}
{intl.formatMessage({ id: 'transfer.amount_select_description' }, {suffix:amountLimitText})}
</Text>
<TransferFormItem
label={intl.formatMessage({ id: 'transfer.amount' })}

View File

@ -705,9 +705,10 @@
"invalid_amount": "Invalid Amount",
"invalid_amount_desc": "Please enter valid amount",
"account_select_title": "Account Details",
"account_select_description": "Operations related to funds are irreversible, make sure receivers username is correct",
"amount_select_title": "Transfer Details",
"amount_select_description": "Enter transfer amount within maximum available balance and must be greater than 0.001"
"account_select_description": "Operations related to funds are irreversible, make sure username is correct",
"amount_select_title": "Action Details",
"amount_select_description": "Enter amount within maximum available balance {suffix}",
"amount_select_desc_limit":" and must be greater than 0.001"
},
"boost": {
"title": "Get Points",

View File

@ -1,4 +1,4 @@
import React, { Fragment, useState, useRef } from 'react';
import React, { Fragment, useState, useRef, useMemo } from 'react';
import { Text, View } from 'react-native';
import { WebView } from 'react-native-webview';
import { injectIntl } from 'react-intl';
@ -65,8 +65,11 @@ const TransferView = ({
);
const [hsTransfer, setHsTransfer] = useState(false);
const [isTransfering, setIsTransfering] = useState(false);
const confirm = useRef(null);
const isEngineToken = useMemo(()=>transferType.endsWith('_engine'), [transferType]);
const _handleTransferAction = () => {
setIsTransfering(true);
if (accountType === AUTH_TYPE.STEEM_CONNECT) {
@ -123,7 +126,7 @@ const TransferView = ({
path = `sign/withdraw_vesting?account=${currentAccountName}&vesting_shares=${encodeURIComponent(
`${amount} ${fundType}`,
)}`;
} else if (transferType.endsWith('_engine')) {
} else if (isEngineToken) {
const json = getEngineActionJSON(
transferType.split('_')[0],
destination,
@ -143,6 +146,9 @@ const TransferView = ({
)}&memo=${encodeURIComponent(memo)}`;
}
}
const nextBtnDisabled = !((isEngineToken ? amount > 0 : amount >= 0.001) && isUsernameValid);
return (
<Fragment>
<BasicHeader
@ -187,11 +193,12 @@ const TransferView = ({
selectedAccount={selectedAccount}
fundType={fundType}
currentAccountName={currentAccountName}
disableMinimum={isEngineToken}
/>
<View style={styles.bottomContent}>
<MainButton
style={styles.button}
isDisable={!(amount >= 0.001 && isUsernameValid)}
isDisable={nextBtnDisabled}
onPress={() => confirm.current.show()}
isLoading={isTransfering}
>