Refactor
All checks were successful
/ maven-build (push) Successful in 20s

This commit is contained in:
Manuel Friedli 2026-03-07 23:47:38 +01:00
parent 824f038084
commit 3efb87bcd8
Signed by: manuel
GPG key ID: 41D08ABA75634DA1
24 changed files with 14 additions and 19 deletions

View file

@ -8,12 +8,8 @@ import {
} from "./state/action.ts"; } from "./state/action.ts";
import styles from "./input-form.module.scss"; import styles from "./input-form.module.scss";
import "./input-form.scss"; import "./input-form.scss";
import {State} from "@/app/state/state.ts"; import {State} from "./state/state.ts";
import { import {ValidatingInputNumberField, ValidatingInputRegExpField, ValidatorFunction} from "./validating-input-field.tsx";
ValidatingInputNumberField,
ValidatingInputRegExpField,
ValidatorFunction
} from "@/app/validating-input-field.tsx";
export default function InputForm({state, dispatch}: { export default function InputForm({state, dispatch}: {
state: State, state: State,
@ -39,7 +35,7 @@ export default function InputForm({state, dispatch}: {
dispatch(actionLoadingFailed(reason)); dispatch(actionLoadingFailed(reason));
}); });
}; };
const validateSizeInput: ValidatorFunction<string, number> = value => { const validateSizeInput: ValidatorFunction<string, number> = (value: string) => {
const numberValue = Number(value); const numberValue = Number(value);
if (isNaN(numberValue) || "" === value || (Math.floor(numberValue) !== numberValue)) { if (isNaN(numberValue) || "" === value || (Math.floor(numberValue) !== numberValue)) {
return { return {

View file

@ -4,17 +4,15 @@ import "./globals.scss";
export const metadata: Metadata = { export const metadata: Metadata = {
title: "A-Maze-R! Create your own Maze!", title: "A-Maze-R! Create your own Maze!",
description: "A Maze Generator by fritteli", description: "A Maze Generator by fritteli",
icons: "./favicon.ico" icons: "/favicon.ico"
}; };
export default function RootLayout({children}: Readonly<{ export default function RootLayout({children}: {
children: React.ReactNode; children: React.ReactNode;
}>) { }) {
return ( return (
<html lang="en"> <html lang="en">
<body> <body>{children}</body>
{children}
</body>
</html> </html>
); );
} }

View file

@ -1,8 +1,8 @@
import Cell from "./cell.tsx"; import Cell from "./cell.tsx";
import styles from "./maze.module.css"; import styles from "./maze.module.css";
import {State} from "@/app/state/state.ts"; import {State} from "./state/state.ts";
import {ActionDispatch, JSX} from "react"; import {ActionDispatch, JSX} from "react";
import {Action} from "@/app/state/action.ts"; import {Action} from "./state/action.ts";
export default function Maze({state, dispatch}: export default function Maze({state, dispatch}:
{ {

View file

@ -1,6 +1,6 @@
import {Action, actionClosedMessageBanner} from "./state/action.ts"; import {Action, actionClosedMessageBanner} from "./state/action.ts";
import styles from "./message-banner.module.css"; import styles from "./message-banner.module.css";
import {State} from "@/app/state/state.ts"; import {State} from "./state/state.ts";
import {ActionDispatch} from "react"; import {ActionDispatch} from "react";
export default function MessageBanner({state, dispatch}: export default function MessageBanner({state, dispatch}:

View file

@ -9,7 +9,7 @@ import {
ID_ACTION_STARTED_LOADING, ID_ACTION_STARTED_LOADING,
ID_ACTION_TOGGLED_SHOW_SOLUTION ID_ACTION_TOGGLED_SHOW_SOLUTION
} from "./action.ts"; } from "./action.ts";
import Maze from "@/app/model/maze.ts"; import Maze from "../model/maze.ts";
export default function reduce(state: State, action: Action): State { export default function reduce(state: State, action: Action): State {
switch (action.type) { switch (action.type) {

2
next-env.d.ts vendored
View file

@ -1,6 +1,6 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts"; import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View file

@ -6,7 +6,8 @@
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "eslint" "lint": "eslint",
"lint:fix": "eslint --fix"
}, },
"dependencies": { "dependencies": {
"next": "16.1.6", "next": "16.1.6",

View file

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 894 B

Before After
Before After