-
Notifications
You must be signed in to change notification settings - Fork 193
fix: add truncate filter to the wallet balance in the profile #1634
fix: add truncate filter to the wallet balance in the profile #1634
Conversation
@@ -38,7 +38,7 @@ | |||
</div> | |||
|
|||
<span class="font-bold my-2 text-lg"> | |||
{{ profileBalance(profile) }} | |||
{{ profileBalance(profile) | truncate(15) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests for this, please. An alternative place to truncate could be in the profileBalance
method as that already has 1 test, just add additional tests for longer variations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the truncate
css class a better alternative here? Truncating like above will yield unexpected results for locales where the currency symbol follows the amount, i.e. the symbol will potentially be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexbarnsley tests added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brenopolanski I actually like @dated's suggestion to use the truncate
css class 😅 Would you mind trying that approach instead please. Sorry, I only just saw dated's reply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexbarnsley @dated i tested using truncate
css class and the result is better:
For the truncate
class works with <span>
tag it's necessary to use the display: inline-block
property, then the .my-2
class works well now.
Your pull request doesn't have a test case, which is a requirement for it to be merged. Please provide it and one of the developers will review it before merging. |
@alexbarnsley can you review this PR again? |
Summary
Fixes #1630.
Checklist