From 03a3f4a6f2d6c04a8a19813bf3502e3a2728a88f Mon Sep 17 00:00:00 2001 From: Eero Holmala Date: Mon, 11 Aug 2025 13:14:25 +0300 Subject: [PATCH] Move frontend components forward to new implementation --- README.md | 8 ++ WretchedMachines.sln | 31 ------- html/about.html | 16 ++++ html/index.html | 3 +- html/script.js | 3 + openapitools.json | 7 -- package-lock.json | 22 ----- package.json | 5 -- .../app/components/ui/card.tsx | 3 +- .../app/components/ui/content-box.tsx | 2 +- .../app/components/ui/footer.tsx | 3 +- .../app/components/ui/form-input.tsx | 3 +- .../app/components/ui/form.tsx | 2 +- .../app/components/ui/navbar.tsx | 17 ++-- .../app/components/ui/page-title.tsx | 3 +- wretched-machines-frontend2/app/routes.ts | 1 + .../app/routes/auth/register.tsx | 84 +++++++++++++++++++ 17 files changed, 128 insertions(+), 85 deletions(-) delete mode 100644 WretchedMachines.sln create mode 100644 html/about.html create mode 100644 html/script.js delete mode 100644 openapitools.json delete mode 100644 package-lock.json delete mode 100644 package.json create mode 100644 wretched-machines-frontend2/app/routes/auth/register.tsx diff --git a/README.md b/README.md index 6d07695..f7e1b22 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # Wretched Machines + + +## Pages + +### Tools + +There should be a tools page for downloading programs. It should contain info on them i.e. when was this uploaded/last updated and there needs so be some sort of verifiable metadata. + diff --git a/WretchedMachines.sln b/WretchedMachines.sln deleted file mode 100644 index aca9aa2..0000000 --- a/WretchedMachines.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataAccess", "DataAccess\DataAccess.csproj", "{5CDDA6D2-BB0B-42A3-B73D-35BAD118D857}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WretchedMachines", "WretchedMachines\WretchedMachines.csproj", "{98C5D04A-56C5-4E44-B05F-CD2F77EB97C1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5CDDA6D2-BB0B-42A3-B73D-35BAD118D857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CDDA6D2-BB0B-42A3-B73D-35BAD118D857}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CDDA6D2-BB0B-42A3-B73D-35BAD118D857}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CDDA6D2-BB0B-42A3-B73D-35BAD118D857}.Release|Any CPU.Build.0 = Release|Any CPU - {98C5D04A-56C5-4E44-B05F-CD2F77EB97C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {98C5D04A-56C5-4E44-B05F-CD2F77EB97C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {98C5D04A-56C5-4E44-B05F-CD2F77EB97C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {98C5D04A-56C5-4E44-B05F-CD2F77EB97C1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F5986BE1-F9CB-46E5-A886-A8625FC0D28F} - EndGlobalSection -EndGlobal diff --git a/html/about.html b/html/about.html new file mode 100644 index 0000000..0d7f507 --- /dev/null +++ b/html/about.html @@ -0,0 +1,16 @@ + + + + + Wretched Machines | About + + + + + + + + + + + \ No newline at end of file diff --git a/html/index.html b/html/index.html index 5fac70d..bdac077 100644 --- a/html/index.html +++ b/html/index.html @@ -14,7 +14,7 @@
@@ -36,4 +36,5 @@ + \ No newline at end of file diff --git a/html/script.js b/html/script.js new file mode 100644 index 0000000..762a918 --- /dev/null +++ b/html/script.js @@ -0,0 +1,3 @@ +(function() { + console.log("init"); +})() \ No newline at end of file diff --git a/openapitools.json b/openapitools.json deleted file mode 100644 index 6f7db3e..0000000 --- a/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "7.12.0" - } -} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 85b821b..0000000 --- a/package-lock.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "WretchedMachines", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "tailwind-merge": "^3.3.0" - } - }, - "node_modules/tailwind-merge": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.0.tgz", - "integrity": "sha512-fyW/pEfcQSiigd5SNn0nApUOxx0zB/dm6UDU/rEwc2c3sX2smWUNbapHv+QRqLGVp9GWX3THIa7MUGPo+YkDzQ==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/dcastil" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 7bd7ccb..0000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "tailwind-merge": "^3.3.0" - } -} diff --git a/wretched-machines-frontend2/app/components/ui/card.tsx b/wretched-machines-frontend2/app/components/ui/card.tsx index afa13ec..1594861 100644 --- a/wretched-machines-frontend2/app/components/ui/card.tsx +++ b/wretched-machines-frontend2/app/components/ui/card.tsx @@ -1,7 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" - +import { cn } from "../../lib/utils" const Card = React.forwardRef< HTMLDivElement, React.HTMLAttributes diff --git a/wretched-machines-frontend2/app/components/ui/content-box.tsx b/wretched-machines-frontend2/app/components/ui/content-box.tsx index 1c04fdc..d29abba 100644 --- a/wretched-machines-frontend2/app/components/ui/content-box.tsx +++ b/wretched-machines-frontend2/app/components/ui/content-box.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "../../lib/utils" interface ContentBoxProps { title: string, diff --git a/wretched-machines-frontend2/app/components/ui/footer.tsx b/wretched-machines-frontend2/app/components/ui/footer.tsx index d1473ee..c136a9c 100644 --- a/wretched-machines-frontend2/app/components/ui/footer.tsx +++ b/wretched-machines-frontend2/app/components/ui/footer.tsx @@ -1,5 +1,4 @@ -import { cn } from "@/lib/utils"; - +import { cn } from "../../lib/utils" type FooterProps = { children?: React.ReactNode; }; diff --git a/wretched-machines-frontend2/app/components/ui/form-input.tsx b/wretched-machines-frontend2/app/components/ui/form-input.tsx index e80dcde..967d470 100644 --- a/wretched-machines-frontend2/app/components/ui/form-input.tsx +++ b/wretched-machines-frontend2/app/components/ui/form-input.tsx @@ -1,5 +1,4 @@ -import { cn } from "@/lib/utils" - +import { cn } from "../../lib/utils" interface FormTextInputProps { value: string, name: string, diff --git a/wretched-machines-frontend2/app/components/ui/form.tsx b/wretched-machines-frontend2/app/components/ui/form.tsx index 4556bf0..8120cef 100644 --- a/wretched-machines-frontend2/app/components/ui/form.tsx +++ b/wretched-machines-frontend2/app/components/ui/form.tsx @@ -1,5 +1,5 @@ import React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../../lib/utils" interface FormProps { children: React.ReactNode, diff --git a/wretched-machines-frontend2/app/components/ui/navbar.tsx b/wretched-machines-frontend2/app/components/ui/navbar.tsx index ecdf4fd..15d1e39 100644 --- a/wretched-machines-frontend2/app/components/ui/navbar.tsx +++ b/wretched-machines-frontend2/app/components/ui/navbar.tsx @@ -1,6 +1,5 @@ -import Link from "next/link"; -import { cn } from "@/lib/utils" - +import { Link }from "react-router"; +import { cn } from "../../lib/utils" const Break = ()=>
@@ -49,22 +48,22 @@ const Navbar = ()=>{
- + Home - + Blog - + Tools - + Demos
- Login - Register + Login + Register
diff --git a/wretched-machines-frontend2/app/components/ui/page-title.tsx b/wretched-machines-frontend2/app/components/ui/page-title.tsx index b0c7b5d..8c3f76e 100644 --- a/wretched-machines-frontend2/app/components/ui/page-title.tsx +++ b/wretched-machines-frontend2/app/components/ui/page-title.tsx @@ -1,5 +1,4 @@ -import { cn } from "@/lib/utils" - +import { cn } from "../../lib/utils" interface PageTitleProps { title: string } diff --git a/wretched-machines-frontend2/app/routes.ts b/wretched-machines-frontend2/app/routes.ts index 6b2c5de..deba8a5 100644 --- a/wretched-machines-frontend2/app/routes.ts +++ b/wretched-machines-frontend2/app/routes.ts @@ -4,5 +4,6 @@ export default [ index("routes/home.tsx"), ...prefix("auth",[ index("./routes/auth/login.tsx"), + route("register", "./routes/auth/register.tsx") ]) ] satisfies RouteConfig; diff --git a/wretched-machines-frontend2/app/routes/auth/register.tsx b/wretched-machines-frontend2/app/routes/auth/register.tsx new file mode 100644 index 0000000..5667bc2 --- /dev/null +++ b/wretched-machines-frontend2/app/routes/auth/register.tsx @@ -0,0 +1,84 @@ +import Form from "../../components/ui/form"; +import { FormLabel, FormSubmitInput, FormTextInput } from "../../components/ui/form-input"; +import PageTitle from "../../components/ui/page-title"; +import { type ChangeEvent, useState } from "react"; + +const Register = () => { + + const [inputData, setInputData] = useState({ + "email": "", + "username": "", + "password": "", + "confirmPassword": "" + }); + + const [error, setError] = useState(""); + + const handleAction = async (formData: FormData) => { + const email= formData.get("email")!.toString(); + const password = formData.get("password")!.toString(); + const username = formData.get("username")!.toString(); + + const res = await fetch("http://127.0.0.1/", { + method: "POST", + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + "email": btoa(email), + "username": btoa(username), + "password": btoa(password), + }) + }); + if(!res.ok) + { + setError(`${res.statusText}`); + } + return await res.json(); + + + + } + + const handleChange = (e: ChangeEvent) => { + e.preventDefault(); + setInputData({ + ...inputData, + [e.target.name]: e.target.value + }); + } + + return ( +
+ +
+
+
+ + +
+
+ + +
+
+ + + +
+
+ + +

Please choose a password.

+
+
+ +
+
+
+ +
+ ); +} + +export default Register;