Skip to content

Commit

Permalink
Merge branch 'release/7.34.0' into chore/cherry-pick-custom-spans
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini authored Oct 25, 2024
2 parents ce0bef3 + 45e0b54 commit e2f6413
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 27 deletions.
6 changes: 1 addition & 5 deletions app/components/UI/ReceiveRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ import GlobalAlert from '../GlobalAlert';
import StyledButton from '../StyledButton';
import ClipboardManager from '../../../core/ClipboardManager';
import { ThemeContext, mockTheme } from '../../../util/theme';
import {
selectChainId,
selectTicker,
} from '../../../selectors/networkController';
import { selectChainId } from '../../../selectors/networkController';
import { isNetworkRampSupported } from '../Ramp/utils';
import { createBuyNavigationDetails } from '../Ramp/routes/utils';
import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController';
Expand Down Expand Up @@ -271,7 +268,6 @@ ReceiveRequest.contextType = ThemeContext;

const mapStateToProps = (state) => ({
chainId: selectChainId(state),
ticker: selectTicker(state),
selectedAddress: selectSelectedInternalAccountChecksummedAddress(state),
receiveAsset: state.modals.receiveAsset,
seedphraseBackedUp: state.user.seedphraseBackedUp,
Expand Down
8 changes: 2 additions & 6 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1709,16 +1709,12 @@ function SwapsQuotesView({
{(!hasEnoughTokenBalance || !hasEnoughEthBalance) && (
<View style={styles.alertBar}>
<Alert small type={AlertType.Info}>
{`${strings('swaps.you_need')} `}
<Text reset bold>
{!hasEnoughTokenBalance && !isSwapsNativeAsset(sourceToken)
? `${renderFromTokenMinimalUnit(
missingTokenBalance,
sourceToken.decimals,
)} ${
sourceToken.symbol
// eslint-disable-next-line no-mixed-spaces-and-tabs
} `
)} ${sourceToken.symbol} `
: `${renderFromWei(missingEthBalance)} ${getTicker(ticker)} `}
</Text>
{!hasEnoughTokenBalance
Expand All @@ -1727,7 +1723,7 @@ function SwapsQuotesView({
{(isSwapsNativeAsset(sourceToken) ||
(hasEnoughTokenBalance && !hasEnoughEthBalance)) && (
<Text link underline small onPress={buyEth}>
{strings('swaps.buy_more', { ticker: getTicker(ticker) })}
{strings('swaps.token_marketplace')}
</Text>
)}
</Alert>
Expand Down
6 changes: 4 additions & 2 deletions app/components/UI/Tokens/TokenList/TokenListFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ export const TokenListFooter = ({
{isBuyableToken && (
<View style={styles.buy}>
<Text variant={TextVariant.HeadingSM} style={styles.buyTitle}>
{strings('wallet.add_to_get_started')}
{strings('wallet.token_is_needed_to_continue', {
tokenSymbol: mainToken.symbol,
})}
</Text>
<Button
variant={ButtonVariants.Primary}
size={ButtonSize.Lg}
width={ButtonWidthTypes.Full}
style={styles.buyButton}
onPress={goToBuy}
label={strings('wallet.buy_asset', { asset: mainToken.symbol })}
label={strings('wallet.next')}
/>
</View>
)}
Expand Down
18 changes: 14 additions & 4 deletions app/components/Views/confirmations/SendFlow/Amount/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ class Amount extends PureComponent {
isNetworkBuyNativeTokenSupported,
swapsIsLive,
chainId,
ticker,
} = this.props;
const colors = this.context.colors || mockTheme.colors;
const themeAppearance = this.context.themeAppearance || 'light';
Expand Down Expand Up @@ -1346,11 +1347,20 @@ class Amount extends PureComponent {
onPress={navigateToBuyOrSwaps}
style={styles.errorBuyWrapper}
>
<Text style={styles.error}>{amountError}</Text>
{isNetworkBuyNativeTokenSupported && selectedAsset.isETH && (
<Text style={[styles.error, styles.underline]}>
{strings('transaction.buy_more')}
{isNetworkBuyNativeTokenSupported && selectedAsset.isETH ? (
<Text style={[styles.error]}>
{strings('transaction.more_to_continue', {
ticker: getTicker(ticker),
})}
{'\n'}
<Text style={[styles.error, styles.underline]}>
{strings('transaction.token_Marketplace')}
</Text>
{'\n'}
{strings('transaction.you_can_also_send_funds')}
</Text>
) : (
<Text style={styles.error}>{amountError}</Text>
)}

{isSwappable && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ class Confirm extends PureComponent {
const errorPress = isTestNetwork ? this.goToFaucet : this.buyEth;
const errorLinkText = isTestNetwork
? strings('transaction.go_to_faucet')
: strings('transaction.buy_more');
: strings('transaction.token_marketplace');

return (
<SafeAreaView
Expand Down
11 changes: 7 additions & 4 deletions app/components/Views/confirmations/SendFlow/SendTo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,13 @@ class SendFlow extends PureComponent {

return (
<>
<Text bold style={styles.buyEth} onPress={this.goToBuy}>
{strings('fiat_on_ramp.buy', {
ticker: getTicker(this.props.ticker),
})}
<Text> </Text>
<Text reset bold link underline onPress={this.goToBuy}>
{strings('fiat_on_ramp_aggregator.token_marketplace')}.
</Text>
<Text reset>
{'\n'}
{strings('transaction.you_can_also_send_funds')}
</Text>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ class ApproveTransactionReview extends PureComponent {
const errorPress = isTestNetwork ? this.goToFaucet : this.buyEth;
const errorLinkText = isTestNetwork
? strings('transaction.go_to_faucet')
: strings('transaction.buy_more');
: strings('transaction.token_marketplace');

const showFeeMarket =
!gasEstimateType ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ class TransactionReviewInformation extends PureComponent {
const errorPress = this.isTestNetwork() ? this.goToFaucet : this.buyEth;
const errorLinkText = this.isTestNetwork()
? strings('transaction.go_to_faucet')
: strings('transaction.buy_more');
: strings('transaction.token_marketplace');

const showFeeMarket =
(!gasEstimateType ||
Expand Down
13 changes: 10 additions & 3 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@
"confirm_cta": "Confirm"
},
"add_to_get_started": "Add crypto to get started",
"token_is_needed_to_continue": "{{tokenSymbol}} is needed to continue",
"next": "Next",
"buy_asset": "Buy {{asset}}",
"no_tokens": "You don't have any tokens!",
"no_nfts_yet": "No NFTs yet",
Expand Down Expand Up @@ -1245,6 +1247,7 @@
"asset_overview": {
"send_button": "Send",
"buy_button": "Buy",
"token_marketplace": "Token marketplace",
"sell_button": "Sell",
"receive_button": "Receive",
"portfolio_button": "Portfolio",
Expand Down Expand Up @@ -1400,6 +1403,10 @@
"insufficient_amount": "You need {{amount}} more {{tokenSymbol}} to complete this transaction.",
"buy_more_eth": "Buy more ETH",
"buy_more": "Buy more",
"more_to_continue": "More {{ticker}} is needed to continue",
"you_can_also_send_funds": "You can also send funds from another account.",
"token_marketplace": "Token marketplace",
"token_Marketplace": "Token Marketplace",
"go_to_faucet": "Go to faucet",
"get_ether": "Get Ether for the {{networkName}} network.",
"insufficient_tokens": "Insufficient {{token}}",
Expand Down Expand Up @@ -1447,7 +1454,7 @@
"asset": "Asset",
"balance": "Balance",
"token_id": "Token ID",
"not_enough_for_gas": "You have 0 {{ticker}} in your account to pay for transaction fees. Buy some {{ticker}} or deposit from another account.",
"not_enough_for_gas": "You have 0 {{ticker}} in your account to pay for transaction fees.",
"send": "Send",
"confirm_with_qr_hardware": "Confirm with hardware wallet",
"confirm_with_ledger_hardware": "Confirm with Ledger",
Expand Down Expand Up @@ -2413,6 +2420,7 @@
"All": "All",
"Buy": "Buy",
"Sell": "Sell",
"token_marketplace": "Token marketplace",
"Purchased": "Purchased",
"Sold": "Sold",
"empty_buy_orders_list": "You don't have any buy orders",
Expand Down Expand Up @@ -2679,8 +2687,7 @@
"you_need": "You need",
"more_to_complete": "more to complete this swap.",
"more_gas_to_complete": "more for gas to complete this swap.",
"buy_more_eth": "Buy more ETH.",
"buy_more": "Buy more {{ticker}}.",
"token_marketplace": "Token marketplace",
"market_price_unavailable_title": "Check your rate before proceeding",
"market_price_unavailable": "Market price is unavailable and price impact is therefore unknown. Please verify that you are comfortable with the amount of tokens you will receive before swapping.",
"price_difference": "Price difference of {{amount}}",
Expand Down

0 comments on commit e2f6413

Please sign in to comment.