-
Notifications
You must be signed in to change notification settings - Fork 83
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
New Donation Flow - Alerts and Summary Column #1314
New Donation Flow - Alerts and Summary Column #1314
Conversation
…04/frontend into payment-process-stripe
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.
Yet another swift update of the payment flow @dimitur2204
I see strong progress with this one.
Shared some ideas for code reusability and simplification.
const { campaign, stripePaymentIntent, paymentError, setPaymentError } = | ||
useContext(DonationFlowContext) |
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.
We can add a helper hook to get the context in a seamless way with:
export function useDonationFlow() {
return useContext(DonationFlowContext)
}
const { campaign, stripePaymentIntent, paymentError, setPaymentError } = | |
useContext(DonationFlowContext) | |
const { campaign, stripePaymentIntent, paymentError, setPaymentError } = useDonationFlow() |
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.
Done in d45154f
children: ( | ||
<Box> | ||
<Typography>Избирайки да се впишете. ще можете да:</Typography> | ||
<List |
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.
We can extract this list as separate component to simplify the rendering of alerts
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.
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.
Removed all on the list items, but kept the one on the X
button row
268a561
into
podkrepi-bg:1272-epic-new-version-of-the-donation-flow
Awesome update! |
Closes #1286
Motivation and context
Form Improvements:
otherAmount
field bug when there is an uneven amount of pricesAlerts column:
AlertsColumn
which takes asectionsRefArray
which is an array of references. It then attaches alerts to each of the section references based on their id which is mapped to the[alerts](https://github.com/podkrepi-bg/frontend/pull/1314/files#diff-0b9f0d19b2035c89f509f8bf65f75cbc4ced3b1209c50b243ebd57ae86c2ebe9R39)
AnchoredAlert
which is an alert that takes asectionRef
and is absolutely positioned with a top equal tosection.offsetTop + spacing and titles on the section (theme.spacing(4) + 1.5rem)
PaymentSummaryAlert
which is the summary of the payment, taxes and total of your payment.Screenshots:
Desktop
Mobile
RFC
I think that this Anchoring approach might be problematic since React does not control refs and from my experience rerendering can be unpredictable.
If another viable approach comes to mind to anyone it would be good to hear @podkrepi-bg/frontend-maintainers
Affected urls
campaign/donation-v2/{slug}