-
Notifications
You must be signed in to change notification settings - Fork 185
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 #803 - Exit out of survey banner #954
Conversation
Design query: Is it just me or are those buttons a little too close to the survey question? Should adding small design tweaks be made in a PR addressing a different/specific issue? What is the recommended practice for that? |
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.
Added some Protocol-specific CSS naming conventions notes.
static/scss/partials/main.scss
Outdated
.micro-survey-banner.hidden { | ||
display: none; | ||
.micro-survey-banner.is-hidden { | ||
display: none !important; |
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 the !important
here necessary?
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.
One JavaScript edit. I think we're almost there!
static/js/app.js
Outdated
|
||
//Micro Survey Banner | ||
function dismissSurvey() { | ||
var survey_banner = document.getElementById("micro-survey-banner"); |
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 should use const
(and let
) instead of var
.
var survey_banner = document.getElementById("micro-survey-banner"); | |
const survey_banner = document.getElementById("micro-survey-banner"); |
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! Ques: why do we use const
over var
?
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.
It's a convention from ES6. The const
value can't be changed through reassignment, and it can't be redeclared. Since it cannot be reassigned, you have less scenarios, side effects or edge cases to consider.
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.
Correction – Can you catch this up with main
first?
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.
Conflicts!
Preview:
https://user-images.githubusercontent.com/13066134/126832640-71876738-04c1-437d-82f8-786a95a4570c.mov