-
Notifications
You must be signed in to change notification settings - Fork 106
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
fix(Bonus Pagamenti Digitali): [#176477833] Fixed mistake that inhibited BPD CTA to properly show #2738
Conversation
Affected stories
|
Codecov Report
@@ Coverage Diff @@
## master #2738 +/- ##
=======================================
Coverage 53.68% 53.68%
=======================================
Files 780 780
Lines 21530 21530
Branches 4078 4078
=======================================
Hits 11558 11558
Misses 9917 9917
Partials 55 55
Continue to review full report at Codecov.
|
const [CTAVisibility, setCTAVisibility] = React.useState(false); | ||
|
||
const setCTAVisible = () => setCTAVisibility(true); | ||
const setCTAVisible = () => | ||
setTimeout(() => setCTAVisibility(true), SHOW_CTA_DELAY); |
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.
setTimeout(() => setCTAVisibility(true), SHOW_CTA_DELAY); | |
setCTAVisibility(true); |
We can avoid the usage of a setTimeout
here, I tested the solution with the direct call of a setState and it actually works
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.
@thisisjp If we remove setTimeout
the CTA will actually be visible a fraction of a second before the content appears, but we get better code readibility, is this ok with you?
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.
no problem at all, thanks ;)
Short description
This was tricky, apparently we need to use JSX to make hooks work.
How to test
Registrazione.schermo.2021-01-19.alle.19.20.59.mov