Skip to content

Commit a127912

Browse files
committed
chore: use signal instead of modifying the dom directly
1 parent 2f9cdb2 commit a127912

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

frontend/src/ts/components/layout/footer/Footer.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { JSXElement } from "solid-js";
22

3-
import { getFocus } from "../../../signals/core";
3+
import { getFocus, getIsScreenshotting } from "../../../signals/core";
44
import { showModal } from "../../../stores/modals";
5+
import { cn } from "../../../utils/cn";
56
import { Button } from "../../common/Button";
67

78
import { Keytips } from "./Keytips";
@@ -10,7 +11,11 @@ import { VersionButton } from "./VersionButton";
1011

1112
export function Footer(): JSXElement {
1213
return (
13-
<footer class="text-sub relative text-xs">
14+
<footer
15+
class={cn("text-sub relative text-xs", {
16+
"opacity-0": getIsScreenshotting(),
17+
})}
18+
>
1419
<Keytips />
1520

1621
<div

frontend/src/ts/test/test-screenshot.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getHtmlByUserFlags } from "../controllers/user-flag-controller";
1010
import * as Notifications from "../elements/notifications";
1111
import { convertRemToPixels } from "../utils/numbers";
1212
import * as TestState from "./test-state";
13-
import { qs, qsa } from "../utils/dom";
13+
import { qs } from "../utils/dom";
1414
import { getTheme } from "../signals/theme";
1515

1616
let revealReplay = false;
@@ -29,7 +29,7 @@ function revert(): void {
2929
qs(".pageTest .buttons")?.show();
3030
qs("noscript")?.show();
3131
qs("#nocss")?.show();
32-
qsa("header, footer")?.removeClass("invisible");
32+
qs("header")?.removeClass("invisible");
3333
qs("#result")?.removeClass("noBalloons");
3434
qs(".wordInputHighlight")?.show();
3535
qsa(".highlightContainer")?.show();
@@ -97,7 +97,7 @@ async function generateCanvas(): Promise<HTMLCanvasElement | null> {
9797
// Ensure spacer is removed before adding a new one if function is called rapidly
9898
qs(".pageTest .screenshotSpacer")?.remove();
9999
qs(".page.pageTest")?.prependHtml("<div class='screenshotSpacer'></div>");
100-
qsa("header, footer")?.addClass("invisible");
100+
qs("header")?.addClass("invisible");
101101
qs("#result")?.addClass("noBalloons");
102102
qs(".wordInputHighlight")?.hide();
103103
qsa(".highlightContainer")?.hide();

0 commit comments

Comments
 (0)