From 0c778b88582e6433beff4b27061625d8805cdf49 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 1 Nov 2023 10:08:32 +0800 Subject: [PATCH] Improve dynamic font size (#551) * source value token as balance-input token prop * improve balance-input dynamic font size --- packages/apps/src/components/balance-input.tsx | 14 ++++---------- packages/apps/src/components/transfer.tsx | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/apps/src/components/balance-input.tsx b/packages/apps/src/components/balance-input.tsx index 80870eb55..939e2cbdf 100644 --- a/packages/apps/src/components/balance-input.tsx +++ b/packages/apps/src/components/balance-input.tsx @@ -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]); diff --git a/packages/apps/src/components/transfer.tsx b/packages/apps/src/components/transfer.tsx index dd5cfb7cd..d7b7419e8 100644 --- a/packages/apps/src/components/transfer.tsx +++ b/packages/apps/src/components/transfer.tsx @@ -282,7 +282,7 @@ export default function Transfer() {
}>