Skip to content

Commit

Permalink
Hide CSAT by default
Browse files Browse the repository at this point in the history
Only display the CSAT if the script to handle its interactions was
properly loaded (i.e. not blocked by an adblocker).
  • Loading branch information
Vinnl committed Feb 23, 2022
1 parent fdf3ec3 commit 0b41cb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion static/js/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ function setSurveyedCookie() {
function analyticsSurveyLogic() {
const csatWrapperEl = document.querySelector(".js-csat-wrapper");
if (!isGoogleAnalyticsAvailable()) {
csatWrapperEl.remove();
return;
}
csatWrapperEl.classList.add("is-visible");

const csatQuestionEl = document.querySelector(".js-csat-question");
const csatFollowupEl = document.querySelector(".js-csat-followup");
Expand Down
12 changes: 7 additions & 5 deletions static/scss/partials/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,18 @@ header {
}

.c-csat-wrapper {
display: none;
padding: $spacing-md 0;
background-color: $color-purple-90;
color: $color-white;
position: relative;
text-align: center;
display: none;

@media screen and #{$mq-md} {
&.is-visible {
display: flex;
}
}

& > div {
display: flex;
Expand All @@ -451,10 +457,6 @@ header {
width: 100%;
}

@media screen and #{$mq-md} {
display: flex;
}

.is-hidden {
display: none;
}
Expand Down

0 comments on commit 0b41cb9

Please sign in to comment.