Skip to content

Commit

Permalink
fix: sip10 token default max length, closes #4930
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Mar 9, 2024
1 parent 12c10da commit 6eaea3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ interface AmountFieldProps {
switchableAmount?: React.JSX.Element;
tokenSymbol?: string;
onSetIsSendingMax?(value: boolean): void;
tokenMaxLength?: number;
}
export function AmountField({
autoComplete = 'on',
Expand All @@ -50,6 +51,7 @@ export function AmountField({
onSetIsSendingMax,
switchableAmount,
tokenSymbol,
tokenMaxLength,
}: AmountFieldProps) {
const [field, meta, helpers] = useField('amount');

Expand All @@ -61,7 +63,9 @@ export function AmountField({

const { decimals } = balance;
const symbol = tokenSymbol || balance.symbol;
const maxLength = decimals === 0 ? maxLengthDefault : decimals + 2;

const maxLength = tokenMaxLength || (decimals === 0 ? maxLengthDefault : decimals + 2);

const fontSizeModifier = (maxFontSize - minFontSize) / maxLength;
const subtractedLengthToPositionPrefix = 0.5;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function Sip10TokenSendFormContainer({
}
tokenSymbol={symbol}
autoComplete="off"
tokenMaxLength={Infinity}
/>
);
const selectedAssetField = (
Expand Down

0 comments on commit 6eaea3e

Please sign in to comment.