ipfs-companion
ipfs-companion copied to clipboard
fix: truncate no. of peers to unit of "k" when > 999
#1017
About The issue opener found out that when number of peers is 1000 or above, the last digit might be partially invisible and cause confusion due to the badge's max width.
The core team replied to the issue suggesting to truncate it in the format of "1k", "2k". So I implemented the approach and made this PR.
Original UI

Committed UI Change
- [X] truncate no. of peers to unit of "k" when > 999 (e.g. the count is 2352 in this case)

Show full number when < 999

This is my first PR, please let me know if I could do it better, looking forward to help with other tasks of this repo and IPFS!
Thank you for submitting this PR! A maintainer will be here shortly to review it. We are super grateful, but we are also overloaded! Help us by making sure that:
-
The context for this PR is clear, with relevant discussion, decisions and stakeholders linked/mentioned.
-
Your contribution itself is clear (code comments, self-review for the rest) and in its best form. Follow the code contribution guidelines if they apply.
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment. Next steps:
-
A maintainer will triage and assign priority to this PR, commenting on any missing things and potentially assigning a reviewer for high priority items.
-
The PR gets reviews, discussed and approvals as needed.
-
The PR is merged by maintainers when it has been approved and comments addressed.
We currently aim to provide initial feedback/triaging within seven business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. We are very grateful for your contribution!
sorry that my code didn't pass the test for JS lint, has fixed by using standard JS lint and pushed. Thanks for reviewing!
sorry that my code didn't pass the test for JS lint, has fixed by using standard JS lint and pushed. Thanks for reviewing!
Not a problem. Thanks so much for the contribution! I touched up the code a tiny bit and am giving it my approval now.