Skip to content

Commit

Permalink
Merge branch 'main' into simplify-call-to-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano authored Jun 29, 2023
2 parents 1c74f3f + c43d6b2 commit 6d63594
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
37 changes: 19 additions & 18 deletions src/qiskit_sphinx_theme/assets/styles/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
footer .helpful-container {
.qiskit-analytics-container {
display: inline-flex;
border-top: 1px solid var(--color-background-border);
border-bottom: 1px solid var(--color-background-border);
color: var(--color-foreground-secondary);
}

footer .helpful-container .helpful-question,
footer .helpful-container .was-helpful-thank-you {
padding: 0.625rem 1.25rem 0.625rem 1.25rem;
}
margin-bottom: 1rem;

#was-helpful-thank-you {
visibility: hidden;
}
div,
a {
padding: 0.625rem 1.25rem 0.625rem 1.25rem;
}

a {
color: var(--qiskit-color-purple);
cursor: pointer;
text-decoration: none;

&:hover {
background-color: var(--qiskit-color-purple);
color: #ffffff;
}
}

.helpful-container .helpful-question.yes-link,
.helpful-container .helpful-question.no-link {
color: var(--qiskit-color-purple);
cursor: pointer;
text-decoration: none;
}

.helpful-container .helpful-question.yes-link:hover,
.helpful-container .helpful-question.no-link:hover {
background-color: var(--qiskit-color-purple);
color: #ffffff;
#qiskit-analytics-thank-you {
visibility: hidden;
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{% if analytics_enabled %}
<script>
function userFeedbackClicked(ctaType) {
document.getElementById('was-helpful-thank-you').style.visibility = 'visible';
document.getElementById('qiskit-analytics-thank-you').style.visibility = 'visible';
window.trackCta(`Helpful - ${ctaType}`);
}
</script>
<hr class="helpful-hr hr-top" />
<div class="helpful-container">
<div class="helpful-question">Was this page helpful?</div>
<a class="helpful-question yes-link" onclick="userFeedbackClicked('yes')">Yes</a>
<a class="helpful-question no-link" onclick="userFeedbackClicked('no')">No</a>
<div class="was-helpful-thank-you" id="was-helpful-thank-you">Thank you!</div>
<div class="qiskit-analytics-container">
<div>Was this page helpful?</div>
<a onclick="userFeedbackClicked('yes')">Yes</a>
<a onclick="userFeedbackClicked('no')">No</a>
<div id="qiskit-analytics-thank-you">Thank you!</div>
</div>
<hr class="helpful-hr hr-bottom"/>
{% endif %}
4 changes: 2 additions & 2 deletions tests/js/snapshots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ test.describe("footer", () => {

test("says 'thank you' when analytics clicked", async ({ page }) => {
await page.goto("");
const yesOption = page.locator("a.helpful-question.yes-link");
const yesOption = page.locator("div.qiskit-analytics-container a").first();

// First, check that we change the color of the buttons when hovering.
await yesOption.hover();
Expand All @@ -247,7 +247,7 @@ test.describe("footer", () => {

// Then, check the screenshot when clicking.
await yesOption.click();
const analytics = page.locator("div.helpful-container");
const analytics = page.locator("div.qiskit-analytics-container");
await expect(analytics).toHaveScreenshot();
});
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6d63594

Please sign in to comment.