Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/SendTokensOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ class SendTokensOne extends React.Component {
});

return (
<span className="ml-3">
<span className="ml-3 amount-label">
(
{t`Balance available: `}
{ tokenBalance.status === TOKEN_DOWNLOAD_STATUS.LOADING && (
Expand Down Expand Up @@ -588,21 +588,21 @@ class SendTokensOne extends React.Component {
</div>
)}
</span>
<span style={{ fontSize: '12px', color: '#404040' }}>
<span className="amount-label" style={{ fontSize: '12px', color: '#404040' }}>
{this.renderFeeValue()}
</span>
</div>

<div className="d-flex justify-content-between align-items-center mb-2">
<span style={{ fontWeight: 600, fontSize: '14px' }}>{t`Amount to be sent`}</span>
<span style={{ fontSize: '12px', color: '#404040' }}>
<span className="amount-label" style={{ fontSize: '12px', color: '#404040' }}>
{this.getTotalOutputAmount()} {this.state.selected.symbol}
</span>
</div>

{!this.state.isDepositToken && this.state.fee > 0n && (
<div className="d-flex justify-content-end">
<span style={{ fontSize: '12px', color: '#8e8e93' }}>
<span className="amount-label" style={{ fontSize: '12px', color: '#8e8e93' }}>
<strong>{t`You'll pay:`}</strong>
{` ${this.getTotalOutputAmount()} ${this.state.selected.symbol} + ${formatAmount(this.state.fee, { decimalPlaces: this.props.decimalPlaces, amountFormat: this.props.amountFormat })} HTR`}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tokens/TokenAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class TokenAction extends React.Component {
<div key={this.props.action}>
<h2>{this.props.title}</h2>
<p>{this.props.subtitle}</p>
<p>{this.props.deposit}</p>
<p className={this.props.depositClassName}>{this.props.deposit}</p>
<form className={`mt-4 mb-3 ${this.state.formValidated ? 'was-validated' : ''}`} ref={this.form} onSubmit={(e) => e.preventDefault()}>
{this.props.renderForm()}
</form>
Expand Down
1 change: 1 addition & 0 deletions src/components/tokens/TokenMint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
10 changes: 10 additions & 0 deletions src/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}
8 changes: 4 additions & 4 deletions src/screens/CreateNFT.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ function CreateNFT() {
</div>
</div>
<hr className="mb-5 mt-5"/>
<p><strong>{nativeTokenConfig.symbol} available:</strong> <Amount value={htrBalance} symbol={nativeTokenConfig.symbol} /></p>
<p><strong>Deposit:</strong> <Amount value={depositAmount} symbol={nativeTokenConfig.symbol} /></p>
<p><strong>Fee:</strong> {nftFee} {nativeTokenConfig.symbol}</p>
<p><strong>Total:</strong> <Amount value={tokensUtils.getNFTFee() + depositAmount} symbol={nativeTokenConfig.symbol} /></p>
<p className="amount-label"><strong>{nativeTokenConfig.symbol} available:</strong> <Amount value={htrBalance} symbol={nativeTokenConfig.symbol} /></p>
<p className="amount-label"><strong>Deposit:</strong> <Amount value={depositAmount} symbol={nativeTokenConfig.symbol} /></p>
<p className="amount-label"><strong>Fee:</strong> {nftFee} {nativeTokenConfig.symbol}</p>
<p className="amount-label"><strong>Total:</strong> <Amount value={tokensUtils.getNFTFee() + depositAmount} symbol={nativeTokenConfig.symbol} /></p>
<button type="button" className="mt-3 btn btn-hathor" onClick={onClickCreate}>Create</button>
</form>
<p className="text-danger mt-3">{errorMessage}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/CreateToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function CreateToken() {
if (isDepositToken) {
infoLabel = `${t`Deposit:`} ${tokens.getDepositAmount(amount, depositPercent, decimalPlaces, amountFormat)} ${nativeTokenConfig.symbol} (${availableBalanceText})`;
}
return <p className="mb-0">{infoLabel}</p>;
return <p className="mb-0 amount-label">{infoLabel}</p>;
}

const formContainerStyle = {
Expand Down