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

[React] Fix: Balance label space #4778

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/stale-suns-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fix spacing in native balance label on connect UI
59 changes: 31 additions & 28 deletions packages/thirdweb/biome.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"extends": ["../../biome.json"],
"linter": {
"rules": {
"nursery": {
"noProcessEnv": "warn"
}
}
},
"overrides": [{
"include": ["src/**/*.test.ts","src/**/*.test.tsx", "src/stories/**"],
"linter": {
"rules": {
"nursery": {
"noProcessEnv": "off"
}
}
}
}],
"files": {
"ignore": [
"src/crypto/aes/lib/md5.ts",
"src/utils/promise/p-limit.ts",
"src/utils/bytecode/cbor-decode.ts",
"src/wallets/in-app/native/helpers/wallet/sss.ts",
"src/**/__generated__/**"
]
}
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"extends": ["../../biome.json"],
"linter": {
"rules": {
"nursery": {
"noProcessEnv": "warn",
"useConsistentCurlyBraces": "off"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

}
}
},
"overrides": [
{
"include": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/stories/**"],
"linter": {
"rules": {
"nursery": {
"noProcessEnv": "off"
}
}
}
}
],
"files": {
"ignore": [
"src/crypto/aes/lib/md5.ts",
"src/utils/promise/p-limit.ts",
"src/utils/bytecode/cbor-decode.ts",
"src/wallets/in-app/native/helpers/wallet/sss.ts",
"src/**/__generated__/**"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
color="secondaryText"
weight={400}
>
{formatBalanceOnButton(Number(balanceQuery.data.displayValue))}
{formatBalanceOnButton(Number(balanceQuery.data.displayValue))}{" "}

Check warning on line 263 in packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx#L263

Added line #L263 was not covered by tests
{balanceQuery.data.symbol}
Comment on lines +263 to 264
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use string concat instead

Suggested change
{formatBalanceOnButton(Number(balanceQuery.data.displayValue))}{" "}
{balanceQuery.data.symbol}
{`${formatBalanceOnButton(Number(balanceQuery.data.displayValue))} ${balanceQuery.data.symbol}`}

</Text>
) : (
Expand Down Expand Up @@ -366,7 +366,7 @@
formatNumber(Number(balanceQuery.data.displayValue), 5)
) : (
<Skeleton height="1em" width="100px" />
)}
)}{" "}

Check warning on line 369 in packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx#L369

Added line #L369 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u can string concat the value + symbol and show the skeleton for both (probably better anyways)

{balanceQuery.data?.symbol}
</Text>
</Text>
Expand Down