From 810b7a40d7b2d772ea29e4a042fa08b867c80cad Mon Sep 17 00:00:00 2001 From: raul-oliveira Date: Thu, 23 Jul 2026 12:07:46 -0300 Subject: [PATCH] fix(amount): wrap read-only amount labels instead of overflowing The deposit, fee, available-balance and summary labels on Create Token, Create Fee Token, Create NFT and Send Tokens forced long amounts onto a single line, overflowing their cards. Add a shared `.amount-label` class (overflow-wrap: anywhere) to those read-only labels so they wrap inside the container. The editable amount input is untouched -- it already accepts unlimited decimals with the caret pinned to the end. The Mint deposit label is rendered by the shared TokenAction component, so it gains an opt-in `depositClassName` prop passed only from TokenMint, leaving Delegate and Destroy unaffected. --- src/components/SendTokensOne.js | 8 ++++---- src/components/tokens/TokenAction.js | 2 +- src/components/tokens/TokenMint.js | 1 + src/index.module.scss | 10 ++++++++++ src/screens/CreateNFT.js | 8 ++++---- src/screens/CreateToken.js | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/components/SendTokensOne.js b/src/components/SendTokensOne.js index daca5f8bf..daa5d857a 100644 --- a/src/components/SendTokensOne.js +++ b/src/components/SendTokensOne.js @@ -514,7 +514,7 @@ class SendTokensOne extends React.Component { }); return ( - + ( {t`Balance available: `} { tokenBalance.status === TOKEN_DOWNLOAD_STATUS.LOADING && ( @@ -588,21 +588,21 @@ class SendTokensOne extends React.Component { )} - + {this.renderFeeValue()}
{t`Amount to be sent`} - + {this.getTotalOutputAmount()} {this.state.selected.symbol}
{!this.state.isDepositToken && this.state.fee > 0n && (
- + {t`You'll pay:`} {` ${this.getTotalOutputAmount()} ${this.state.selected.symbol} + ${formatAmount(this.state.fee, { decimalPlaces: this.props.decimalPlaces, amountFormat: this.props.amountFormat })} HTR`} diff --git a/src/components/tokens/TokenAction.js b/src/components/tokens/TokenAction.js index 8eb975bd6..07bb7c208 100644 --- a/src/components/tokens/TokenAction.js +++ b/src/components/tokens/TokenAction.js @@ -164,7 +164,7 @@ class TokenAction extends React.Component {

{this.props.title}

{this.props.subtitle}

-

{this.props.deposit}

+

{this.props.deposit}

e.preventDefault()}> {this.props.renderForm()}
diff --git a/src/components/tokens/TokenMint.js b/src/components/tokens/TokenMint.js index 1556fa01b..828d9cba3 100644 --- a/src/components/tokens/TokenMint.js +++ b/src/components/tokens/TokenMint.js @@ -219,6 +219,7 @@ class TokenMint extends React.Component { title={t`Mint tokens`} subtitle={`A deposit of ${depositPercent * 100}% in ${nativeTokenConfig.symbol} of the mint amount is required`} deposit={`Deposit: ${tokens.getDepositAmount(getAmountToCalculateDeposit(), depositPercent, this.props.decimalPlaces, this.props.amountFormat)} ${nativeTokenConfig.symbol} (${formatAmount(this.props.htrBalance, { decimalPlaces: this.props.decimalPlaces, amountFormat: this.props.amountFormat })} ${nativeTokenConfig.symbol} available)`} + depositClassName="amount-label" buttonName={t`Go`} validateForm={this.mint} getSuccessMessage={this.getSuccessMessage} diff --git a/src/index.module.scss b/src/index.module.scss index e7eda2b6f..643098c1c 100644 --- a/src/index.module.scss +++ b/src/index.module.scss @@ -1458,3 +1458,13 @@ div .nc-token-balance:not(:last-child) { } } } + +/* Read-only amount labels beside inputs (deposit, fee, available balance) */ +.amount-label { + // The label embeds amounts inside a sentence, so the break can land at a + // space normally; `anywhere` is the fallback for a single very long number + // that exceeds the container on its own. + overflow-wrap: anywhere; + white-space: normal; + max-width: 100%; +} diff --git a/src/screens/CreateNFT.js b/src/screens/CreateNFT.js index 039162a62..eed1d7d41 100644 --- a/src/screens/CreateNFT.js +++ b/src/screens/CreateNFT.js @@ -350,10 +350,10 @@ function CreateNFT() {

-

{nativeTokenConfig.symbol} available:

-

Deposit:

-

Fee: {nftFee} {nativeTokenConfig.symbol}

-

Total:

+

{nativeTokenConfig.symbol} available:

+

Deposit:

+

Fee: {nftFee} {nativeTokenConfig.symbol}

+

Total:

{errorMessage}

diff --git a/src/screens/CreateToken.js b/src/screens/CreateToken.js index ae778f545..0040ee374 100644 --- a/src/screens/CreateToken.js +++ b/src/screens/CreateToken.js @@ -334,7 +334,7 @@ function CreateToken() { if (isDepositToken) { infoLabel = `${t`Deposit:`} ${tokens.getDepositAmount(amount, depositPercent, decimalPlaces, amountFormat)} ${nativeTokenConfig.symbol} (${availableBalanceText})`; } - return

{infoLabel}

; + return

{infoLabel}

; } const formContainerStyle = {