Skip to content

Commit

Permalink
Improve dynamic font size (#551)
Browse files Browse the repository at this point in the history
* source value token as balance-input token prop

* improve balance-input dynamic font size
  • Loading branch information
JayJay1024 authored Nov 1, 2023
1 parent d76ee7d commit 0c778b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions packages/apps/src/components/balance-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,15 @@ export function BalanceInput({
} else if (percent < 20) {
setDynamicStyle("text-[3rem] font-extralight");
} else if (percent < 30) {
setDynamicStyle("text-[2.25rem] font-extralight");
setDynamicStyle("text-[2.25rem] font-light");
} else if (percent < 40) {
setDynamicStyle("text-[1.875rem] font-light");
} else if (percent < 50) {
setDynamicStyle("text-[1.5rem] font-light");
setDynamicStyle("text-[1.5rem] font-normal");
} else if (percent < 60) {
setDynamicStyle("text-[1.25rem] font-light");
} else if (percent < 70) {
setDynamicStyle("text-[1.125rem] font-normal");
} else if (percent < 80) {
setDynamicStyle("text-[1rem] font-normal");
} else if (percent < 90) {
setDynamicStyle("text-[0.875rem] font-medium");
setDynamicStyle("text-[1.25rem] font-normal");
} else {
setDynamicStyle("text-[0.75rem] font-medium");
setDynamicStyle("text-[1.125rem] font-medium");
}
}
}, [value, dynamic]);
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/src/components/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default function Transfer() {
<Section label="Amount" className="mt-8" extra={isProduction() ? undefined : <Faucet />}>
<BalanceInput
balance={sourceBalance?.value}
token={sourceBalance?.token}
token={sourceValue?.token}
value={transferValue}
suffix="max"
max={transferable}
Expand Down

0 comments on commit 0c778b8

Please sign in to comment.