Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24321] Large amounts are no longer cut off on smaller widths. #26280

Merged
merged 19 commits into from
Sep 11, 2023
Merged
Changes from 3 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
22 changes: 16 additions & 6 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,16 +1342,26 @@ function getDropDownButtonHeight(buttonSize) {
function getAmountFontSizeAndLineHeight(baseFontSize, baseLineHeight, isSmallScreenWidth, windowWidth, requestAmount) {
let toSubtract = 0;

// requestAmount also includes digits after ".", so "1,000,000.00" qualifies.
if (requestAmount >= 100000000) toSubtract = 2;

if (isSmallScreenWidth) {
const widthDifference = variables.mobileResponsiveWidthBreakpoint - windowWidth;
if (widthDifference > 350) toSubtract = 2;
if (widthDifference > 400) toSubtract = 6;
if (widthDifference > 450) toSubtract = 9;
switch (true) {
Julesssss marked this conversation as resolved.
Show resolved Hide resolved
case widthDifference > 450:
toSubtract += 9;
break;
case widthDifference > 400:
toSubtract += 6;
break;
case widthDifference > 350:
toSubtract += 2;
break;
default:
break;
}
}

// requestAmount also includes digits after ".", so "1,000,000.00" qualifies.
if (requestAmount >= 100000000) toSubtract += 2;

return {
fontSize: baseFontSize - toSubtract,
lineHeight: baseLineHeight - toSubtract,
Expand Down
Loading