-
Notifications
You must be signed in to change notification settings - Fork 92
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
Donation flow more fixes #1991
Donation flow more fixes #1991
Conversation
✅ Tests will run for this PR. Once they succeed it can be merged. |
…repibg-frontend into donation-flow-more-fixes
8b9efe9
to
813875c
Compare
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.
LGTM. I've one question - see in comments
totalAmount: moneyPublicDecimals2(amountWithFees.value), | ||
}} | ||
/> | ||
{!!amountWithFees.value && ( |
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.
Is this to assertain that the value is a non-zero number? As in !isNaN(amountWithFees.value) && amountWithFees.value > 0
It's hard to read. And also negative numbers give true value as well => !!-1 === true
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.
The idea is to show the text from below only if amountWithFees.value is truthy value. The double negation is needed in order to convert the amountWithFees.value to boolean, otherwise if we just pass amountWithFees.value it would display 0 in the DOM.
Yes I get that. What I'm saying is 1 it is unreadable, and 2 it will show
the value when it's negative number or a string or an object etc
…On Wed, Dec 11, 2024, 2:53 PM Aleksandar Petkov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
src/components/client/donation-flow/steps/payment-method/TaxesCheckbox.tsx
<#1991 (comment)>
:
> @@ -50,15 +50,17 @@ export const TaxesCheckbox = () => {
/>
</Grid2>
</Grid2>
- <Trans
- t={t}
- i18nKey="step.payment-method.alert.calculated-fees"
- values={{
- amount: moneyPublicDecimals2(amountWithoutFees.value),
- fees: moneyPublicDecimals2(amountWithFees.value - amountWithoutFees.value),
- totalAmount: moneyPublicDecimals2(amountWithFees.value),
- }}
- />
+ {!!amountWithFees.value && (
The idea is to show the text from below only if amountWithFees.value is
truthy value. The double negation is needed in order to convert the
amountWithFees.value to boolean, otherwise if we just pass
amountWithFees.value it would display 0 in the DOM.
—
Reply to this email directly, view it on GitHub
<#1991 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2SEV7N2BRLNQKRIEO3R5L2FAYVLAVCNFSM6AAAAABTFSTYFSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDIOJVGU4DOMBUGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Abstracted the condition into its own variable(should be more readable now). As for the other concerns, they aren't really a problem, as the otherAmount field can't accept anything other than positive numbers. |
No description provided.