Skip to content

Commit 06d7471

Browse files
committed
Add qr and big text.
1 parent 1d0f62b commit 06d7471

33 files changed

+1215
-515
lines changed

eslint.config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { dirname } from "path";
22
import { fileURLToPath } from "url";
33
import { FlatCompat } from "@eslint/eslintrc";
4+
import stylisticTs from "@stylistic/eslint-plugin-ts";
5+
import stylisticJsx from "@stylistic/eslint-plugin-jsx";
46

57
const __filename = fileURLToPath(import.meta.url);
68
const __dirname = dirname(__filename);
@@ -11,6 +13,18 @@ const compat = new FlatCompat({
1113

1214
const eslintConfig = [
1315
...compat.extends("next/core-web-vitals", "next/typescript"),
16+
{
17+
plugins: {
18+
"@stylistic/ts": stylisticTs,
19+
"@stylistic/jsx": stylisticJsx
20+
},
21+
rules: {
22+
semi: ["warn", "always"],
23+
"@stylistic/ts/indent": ["error", 2],
24+
"@stylistic/jsx/jsx-indent": ["error", 2],
25+
"@stylistic/ts/quotes": ["error", "double", { "avoidEscape": true }]
26+
},
27+
},
1428
];
1529

1630
export default eslintConfig;

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@
1313
"lodash": "^4.17.21",
1414
"next": "15.1.2",
1515
"react": "^19.0.0",
16-
"react-dom": "^19.0.0"
16+
"react-dom": "^19.0.0",
17+
"uqr": "^0.1.2"
1718
},
1819
"devDependencies": {
19-
"@eslint/eslintrc": "^3.2.0",
20+
"@eslint/eslintrc": "^3.3.1",
21+
"@stylistic/eslint-plugin-js": "^4.2.0",
22+
"@stylistic/eslint-plugin-jsx": "^4.2.0",
23+
"@stylistic/eslint-plugin-ts": "^4.2.0",
2024
"@types/brotli": "^1.3.4",
21-
"@types/node": "^20.17.17",
22-
"@types/react": "^19.0.8",
23-
"@types/react-dom": "^19.0.3",
25+
"@types/node": "^22.13.11",
26+
"@types/react": "^19.0.12",
27+
"@types/react-dom": "^19.0.4",
2428
"brotli": "^1.3.3",
25-
"eslint": "^9.20.0",
29+
"eslint": "^9.23.0",
2630
"eslint-config-next": "15.1.2",
27-
"typescript": "^5.7.3",
31+
"typescript": "^5.8.2",
2832
"vitest": "^2.1.9"
2933
}
3034
}

pnpm-lock.yaml

Lines changed: 643 additions & 433 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/fullscreen.svg

Lines changed: 1 addition & 0 deletions
Loading

public/next.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/qrcode.svg

Lines changed: 1 addition & 0 deletions
Loading

public/trashcan.svg

Lines changed: 1 addition & 0 deletions
Loading

public/vercel.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.fullscreen-horizontal {
2+
writing-mode: sideways-rl;
3+
text-orientation: mixed;
4+
word-wrap: break-word;
5+
}
6+
.fullscreen {
7+
display: flex;
8+
justify-content: center;
9+
align-items: center;
10+
height: 100vh;
11+
width: 100vw;
12+
margin: 0;
13+
}
14+
.hidden {
15+
display: none;
16+
opacity: 0;
17+
}
18+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import React, { useEffect, useRef } from "react";
2+
import { useFullscreen } from "@/hooks/useFullscreen";
3+
import styles from "./FullscreenComponent.module.css";
4+
type Props = {
5+
orientation?: "vertical" | "horizontal",
6+
isFullscreenValue: boolean,
7+
updateFullscreenState: (param: boolean) => void
8+
}
9+
export const FullscreenComponent: React.FC<React.PropsWithChildren<Props>> = ({
10+
orientation = "vertical",
11+
isFullscreenValue = false,
12+
updateFullscreenState,
13+
children
14+
}) => {
15+
const isInitialMount = useRef(true);
16+
const { fullscreenRef, isFullscreen: internalIsFullscreen, enterFullscreen, exitFullscreen } = useFullscreen();
17+
18+
useEffect(() => {
19+
if (isInitialMount.current) {
20+
return;
21+
}
22+
if (isFullscreenValue) {
23+
enterFullscreen();
24+
} else {
25+
exitFullscreen();
26+
}
27+
}, [isFullscreenValue, enterFullscreen, exitFullscreen]);
28+
29+
useEffect(() => {
30+
if (isInitialMount.current) {
31+
return;
32+
}
33+
updateFullscreenState(internalIsFullscreen);
34+
}, [internalIsFullscreen, updateFullscreenState]);
35+
36+
useEffect(() => {
37+
isInitialMount.current = false;
38+
}, []);
39+
return (
40+
<div
41+
className={
42+
[
43+
orientation == "horizontal" && styles["fullscreen-horizontal"],
44+
!internalIsFullscreen && styles.hidden,
45+
styles.fullscreen
46+
].join(" ")
47+
}
48+
ref={fullscreenRef}
49+
>
50+
{internalIsFullscreen && children}
51+
</div>
52+
);
53+
};

0 commit comments

Comments
 (0)