fix: update tax display logic

This commit is contained in:
lawvs 2024-10-25 17:03:31 +08:00
parent 7e670a3f72
commit c8ccf352f2
1 changed files with 2 additions and 3 deletions

View File

@ -162,8 +162,7 @@ const BalanceRenderer = ({
amount: NonNullable<ReturnType<typeof useWalletTransactions>["data"]>[number]["powerToken"]
tax: NonNullable<ReturnType<typeof useWalletTransactions>["data"]>[number]["tax"]
}) => {
// tax free or 100% tax
const showTax = tax !== "0" && tax !== amount
const hideTax = sign === "-" || tax === "0"
return (
<div
className={cn("flex items-center", {
@ -173,7 +172,7 @@ const BalanceRenderer = ({
>
{sign}
<Balance className="mr-1">{amount}</Balance>
{showTax && (
{!hideTax && (
<span className="text-xs text-gray-500">
(-<Balance>{tax}</Balance>)
</span>