From cf546a1b5998ad7440a627cbe06d2f2069fbf639 Mon Sep 17 00:00:00 2001 From: 0xa663 <142121896+0xa663@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:29:12 +0100 Subject: [PATCH] Fix linting issues --- src/UI/importMural.tsx | 8 ++++---- src/UI/styles.tsx | 2 +- src/UI/ui.tsx | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/UI/importMural.tsx b/src/UI/importMural.tsx index 93e4587..a22843f 100644 --- a/src/UI/importMural.tsx +++ b/src/UI/importMural.tsx @@ -94,13 +94,13 @@ export async function importArtWork(store: Store, cords: Coordinates, palette: P }, cb: (name, x, y, confirm) => { if (confirm) { - resolve({ name, pixels, x, y }) + resolve({ name, pixels, x, y }); } else { reject(new Error("Canceled by user")); } } }); - }) + }); } } } @@ -225,13 +225,13 @@ export async function getImageSettingFromUser(image: HTMLImageElement): Promise< {processNumberEvent(ev, n => {width = n})}} + onChange={ev => {processNumberEvent(ev, n => {width = n;});}} /> x {processNumberEvent(ev, n => {height = n})}} + onChange={ev => {processNumberEvent(ev, n => {height = n;});}} /> , [ diff --git a/src/UI/styles.tsx b/src/UI/styles.tsx index 1173e9c..3554495 100644 --- a/src/UI/styles.tsx +++ b/src/UI/styles.tsx @@ -53,7 +53,7 @@ export const Theme = styled.div` color: rgb(10, 10, 10); border: 2px solid black; border-radius: 12px; -` +`; export const Border = styled.div` border: 2px solid black; diff --git a/src/UI/ui.tsx b/src/UI/ui.tsx index 39d878f..87223be 100644 --- a/src/UI/ui.tsx +++ b/src/UI/ui.tsx @@ -23,7 +23,7 @@ function appendWindow(children: React.ReactNode) { document.body.appendChild(rootElement); return () => { rootElement.parentElement?.removeChild(rootElement); - } + }; } export class UI { @@ -33,11 +33,11 @@ export class UI { constructor(private store: Store, private palette: Palette) { this.container = document.createElement("div"); const s = this.container.style; - this.container.setAttribute("mod", "pixel-canvas-overlay") + this.container.setAttribute("mod", "pixel-canvas-overlay"); s.position = "fixed"; - s.zIndex = "1000" + s.zIndex = "1000"; s.left = "0px"; - s.bottom = "0px" + s.bottom = "0px"; const container = document.createElement("div"); const ss = container.style; this.container.appendChild(container); @@ -89,13 +89,13 @@ export class UI { pixels, cb: (name, x, y, confirm) => { if (confirm) { - resolve({ name, pixels, x, y }) + resolve({ name, pixels, x, y }); } else { reject(new Error("Canceled by user")); } } }); - }) + }); const heights = prompt(`Enter name and location [name, x, y]`) || ""; const data = heights.split(","); const numbers = [data[1], data[2]].map(e=> parseInt(e.trim(), 10)); @@ -107,7 +107,7 @@ export class UI { x: numbers[0], y: numbers[1], pixels - } + }; try { validateMural(mural); } catch (error) { @@ -116,7 +116,7 @@ export class UI { return mural; } } - } + }; private async importFile() { const fileInput = new FileInput(); fileInput.setAcceptType(["png", "jpg", "jpeg", ...TEXT_FORMATS]); @@ -187,7 +187,7 @@ export class UI { canvas.height = getMuralHeight(mural); ctx.drawImage(mural.ref, 0, 0, canvas.width, canvas.height); const wh = document.createElement("div"); - wh.textContent = `Size ${getMuralWidth(mural)}x${getMuralHeight(mural)}` + wh.textContent = `Size ${getMuralWidth(mural)}x${getMuralHeight(mural)}`; const at = document.createElement("div"); at.textContent = `At: ${mural.x}x${mural.y}`; container.appendChild(h5);