docs(mobile): updated imgs to be a little smaller

This commit is contained in:
2026-05-23 11:21:19 -05:00
parent 1f6637c512
commit 3a27fd8542
28 changed files with 748 additions and 47 deletions

View File

@@ -1,33 +1,46 @@
import { useMutation } from "@tanstack/react-query";
import { Button } from "../../components/ui/button";
//import { useMutation } from "@tanstack/react-query";
//import { Button } from "../../components/ui/button";
import { Separator } from "../../components/ui/separator";
// image imports
const images = import.meta.glob("/src/imgs/docs/mobile/*.{png,jpg,jpeg,webp}", {
eager: true,
query: "w=300;600;1200&format=webp",
import: "default",
}) as Record<string, string>;
const server = window.LST_CONFIG?.server;
const firstScan = images[`/src/imgs/docs/mobile/${server}-1.png`];
const secondScan = images[`/src/imgs/docs/mobile/${server}-2.png`];
const thridScan = images[`/src/imgs/docs/mobile/${server}-3.png`];
export default function UpdateInstructions() {
const getFile = useMutation({
mutationFn: async () => {
// 1. Fetch the file from the public folder
const response = await fetch(
`/lst/app/stage-now/${window.LST_CONFIG?.server}-stageNow.pdf`,
);
if (!response.ok) throw new Error("Network response was not ok");
// const getFile = useMutation({
// mutationFn: async () => {
// // 1. Fetch the file from the public folder
// const response = await fetch(
// `/lst/app/stage-now/${window.LST_CONFIG?.server}-stageNow.pdf`,
// );
// if (!response.ok) throw new Error("Network response was not ok");
// 2. Convert to blob
return await response.blob();
},
onSuccess: (blob) => {
// 3. Create a temporary anchor element to trigger download
const url = window.URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `${window.LST_CONFIG?.server}-stageNow.pdf`; // Desired filename
document.body.appendChild(a);
a.click();
// // 2. Convert to blob
// return await response.blob();
// },
// onSuccess: (blob) => {
// // 3. Create a temporary anchor element to trigger download
// const url = window.URL.createObjectURL(blob);
// const a = document.createElement("a");
// a.href = url;
// a.download = `${window.LST_CONFIG?.server}-stageNow.pdf`; // Desired filename
// document.body.appendChild(a);
// a.click();
// 4. Cleanup
window.URL.revokeObjectURL(url);
document.body.removeChild(a);
},
});
// // 4. Cleanup
// window.URL.revokeObjectURL(url);
// document.body.removeChild(a);
// },
// });
return (
<div className="flex flex-row gap-2">
@@ -41,14 +54,14 @@ export default function UpdateInstructions() {
NOTE: LST Mobile only works on TC8300
</p>
</div>
<div className="flex justify-center">
{/* <div className="flex justify-center">
<Button
onClick={() => getFile.mutate()}
disabled={getFile.isPending}
>
{getFile.isPending ? "Downloading..." : "Get StageNow Codes"}
</Button>
</div>
</div> */}
</div>
<Separator className="m-3" />
<div>
@@ -115,21 +128,9 @@ export default function UpdateInstructions() {
<p>Scan Commands</p>
<Separator className="m-3" />
<div className="flex flex-col justify-center">
<img
src={`/lst/app/imgs/docs/mobile/${window.LST_CONFIG?.server}-1.png`}
alt="Home"
className="m-3"
/>
<img
src={`/lst/app/imgs/docs/mobile/${window.LST_CONFIG?.server}-2.png`}
alt="Home"
className="m-3"
/>
<img
src={`/lst/app/imgs/docs/mobile/${window.LST_CONFIG?.server}-3.png`}
alt="Home"
className="m-3"
/>
<img src={firstScan} alt="Home" className="m-3" />
<img src={secondScan} alt="Home" className="m-3" />
<img src={thridScan} alt="Home" className="m-3" />
</div>
</div>
</div>