diff --git a/app/app.css b/app/app.css index 303fe15..3c43e72 100644 --- a/app/app.css +++ b/app/app.css @@ -4,9 +4,9 @@ html, body { - @apply bg-white dark:bg-gray-950; + @apply bg-white dark:bg-neutral-900; - @media (prefers-color-scheme: dark) { - color-scheme: dark; - } + @media (prefers-color-scheme: dark) { + color-scheme: dark; + } } diff --git a/app/components/button.tsx b/app/components/button.tsx new file mode 100644 index 0000000..08f1d03 --- /dev/null +++ b/app/components/button.tsx @@ -0,0 +1,21 @@ +import clsx from "clsx" + +function Button({ + className, + ...props +}: React.DetailedHTMLProps< + React.ButtonHTMLAttributes, + HTMLButtonElement +>) { + return ( + + ) : null} + + + ))} + {isAddingStage ? ( +
  • + +
  • + ) : null} + + {!isAddingStage ? ( +
    + + + + +
    + ) : ( +
    + + +
    + )} + + ) +}) + +function AddApplicationForm() { + const [isAddingEntry, setIsAddingEntry] = useState(false) + const addEntry = useStore((state) => state.addEntry) + const hasEntry = useStore((state) => state.hasEntry) + const inputRef = useRef(null) + + function onAddButtonClick() { + if (!isAddingEntry) { + setIsAddingEntry(true) + } else if (inputRef.current) { + const entryName = inputRef.current.value + if (hasEntry(entryName)) { + alert(`There is already an application named ${entryName}!`) + } else { + addEntry(entryName) + setIsAddingEntry(false) + } + } + } + + function cancelEntry() { + setIsAddingEntry(false) + } + + return ( +
    + {isAddingEntry ? ( + + ) : null} +
    + + {isAddingEntry ? : null} +
    +
    + ) } diff --git a/app/use-ui-mode.ts b/app/use-ui-mode.ts new file mode 100644 index 0000000..7798056 --- /dev/null +++ b/app/use-ui-mode.ts @@ -0,0 +1,23 @@ +import { useEffect, useState } from "react" + +function useUiMode() { + const [mode, setMode] = useState<"light" | "dark">("light") + + useEffect(() => { + const query = window.matchMedia("(prefers-color-scheme: dark)") + setMode(query.matches ? "dark" : "light") + + function onChange(event: MediaQueryListEvent) { + setMode(event.matches ? "dark" : "light") + } + + query.addEventListener("change", onChange) + return () => { + query.removeEventListener("change", onChange) + } + }, []) + + return mode +} + +export { useUiMode } diff --git a/app/welcome/logo-dark.svg b/app/welcome/logo-dark.svg deleted file mode 100644 index dd82028..0000000 --- a/app/welcome/logo-dark.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/welcome/logo-light.svg b/app/welcome/logo-light.svg deleted file mode 100644 index 7328492..0000000 --- a/app/welcome/logo-light.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/welcome/welcome.tsx b/app/welcome/welcome.tsx deleted file mode 100644 index 8ac6e1d..0000000 --- a/app/welcome/welcome.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import logoDark from "./logo-dark.svg"; -import logoLight from "./logo-light.svg"; - -export function Welcome() { - return ( -
    -
    -
    -
    - React Router - React Router -
    -
    -
    - -
    -
    -
    - ); -} - -const resources = [ - { - href: "https://reactrouter.com/docs", - text: "React Router Docs", - icon: ( - - - - ), - }, - { - href: "https://rmx.as/discord", - text: "Join Discord", - icon: ( - - - - ), - }, -]; diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..bde8525 --- /dev/null +++ b/biome.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": false, + "ignore": [] + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double", + "semicolons": "asNeeded" + } + } +} diff --git a/bun.lockb b/bun.lockb index 772c14a..fec5af0 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 778141f..35b9281 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,17 @@ "dependencies": { "@react-router/node": "^7.1.3", "@react-router/serve": "^7.1.3", + "clsx": "^2.1.1", + "immer": "^10.1.1", "isbot": "^5.1.17", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-router": "^7.1.3" + "react-google-charts": "^5.2.1", + "react-router": "^7.1.3", + "zustand": "^5.0.3" }, "devDependencies": { + "@biomejs/biome": "^1.9.4", "@react-router/dev": "^7.1.3", "@types/node": "^20", "@types/react": "^19.0.1", @@ -27,5 +32,8 @@ "typescript": "^5.7.2", "vite": "^5.4.11", "vite-tsconfig-paths": "^5.1.4" - } + }, + "trustedDependencies": [ + "@biomejs/biome" + ] } \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 5dbdfcd..0000000 Binary files a/public/favicon.ico and /dev/null differ