diff --git a/Mock/App.tsx b/Mock/AppMockup.tsx similarity index 100% rename from Mock/App.tsx rename to Mock/AppMockup.tsx diff --git a/Mock/frontendMockData.json b/Mock/frontendMockData.json new file mode 100644 index 0000000..ad18127 --- /dev/null +++ b/Mock/frontendMockData.json @@ -0,0 +1,20 @@ +[ + { + "id": 1, + "title": "Mock Book 1", + "author": "Author 1", + "description": "Description for Mock Book 1" + }, + { + "id": 2, + "title": "Mock Book 2", + "author": "Author 2", + "description": "Description for Mock Book 2" + }, + { + "id": 3, + "title": "Mock Book 3", + "author": "Author 3", + "description": "Description for Mock Book 3" + } +] \ No newline at end of file diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0a07de3..feb840f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,10 +1,49 @@ import "./App.css"; +import Layout from "./layout/Layout"; +import { useEffect } from "react"; +import Form1 from "./components/Form1"; +import Form2 from "./components/Form2"; +import Form3 from "./components/Form3"; function App() { + const Items = [ + { + id: 1, + title: "Mock Book 1", + author: "Author 1", + description: "Description for Mock Book 1", + }, + { + id: 2, + title: "Mock Book 2", + author: "Author 2", + description: "Description for Mock Book 2", + }, + { + id: 3, + title: "Mock Book 3", + author: "Author 3", + description: "Description for Mock Book 3", + }, + ]; + + useEffect(() => { + localStorage.setItem("allItems", JSON.stringify(Items)); + localStorage.setItem("borrowableItems", JSON.stringify(Items)); + localStorage.setItem("borrowCode", "123456"); + }, []); + return ( - <> -

Hello world!

- + + {/* Mock flow without real logic: show the three sections stacked for design preview */} +
+ +
+ +
+ +
+ ); } diff --git a/frontend/src/components/Form1.tsx b/frontend/src/components/Form1.tsx new file mode 100644 index 0000000..0bb47fb --- /dev/null +++ b/frontend/src/components/Form1.tsx @@ -0,0 +1,45 @@ +import React from "react"; + +const Form1: React.FC = () => { + return ( +
+

1. Zeitraum wählen

+
+
+ + +
+
+ + +
+ +
+
+ ); +}; + +export default Form1; diff --git a/frontend/src/components/Form2.tsx b/frontend/src/components/Form2.tsx new file mode 100644 index 0000000..e5e155b --- /dev/null +++ b/frontend/src/components/Form2.tsx @@ -0,0 +1,61 @@ +import React from "react"; + +const Form2: React.FC = () => { + const items = JSON.parse(localStorage.getItem("borrowableItems") || "[]"); + return ( +
+

+ 2. Gegenstand auswählen +

+
+ {items.length === 0 ? ( +
+ Keine Gegenstände verfügbar für diesen Zeitraum. +
+ ) : ( +
+ {items.map((item: any) => ( + + ))} +
+ )} + +
+ + +
+
+
+ ); +}; + +export default Form2; diff --git a/frontend/src/components/Form3.tsx b/frontend/src/components/Form3.tsx new file mode 100644 index 0000000..ded9b69 --- /dev/null +++ b/frontend/src/components/Form3.tsx @@ -0,0 +1,29 @@ +import React from "react"; +import { myToast } from "../utils/toastify"; + +const Form3: React.FC = () => { + if (localStorage.getItem("borrowCode")) { + myToast("Ausleihe erfolgreich!", "success"); + } else { + myToast("Ausleihe fehlgeschlagen!", "error"); + } + + const code = localStorage.getItem("borrowCode") ?? "—"; + + return ( +
+

3. Ausleihe bestätigt

+
+

Ihr Ausleihcode lautet

+
+ {code} +
+

+ Bitte merken Sie sich diesen Code, um das Schließfach zu öffnen. +

+
+
+ ); +}; + +export default Form3; diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index 20f4c90..319c3e6 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -2,8 +2,13 @@ import React from "react"; const Header: React.FC = () => { return ( -
-

Header

+
+

+ Gegenstand ausleihen +

+

+ Schnell und unkompliziert Equipment reservieren +

); }; diff --git a/frontend/src/components/Object.tsx b/frontend/src/components/Object.tsx new file mode 100644 index 0000000..cb42de5 --- /dev/null +++ b/frontend/src/components/Object.tsx @@ -0,0 +1,20 @@ +import React from "react"; + +type ObjectProps = { + title: string; + description: string; +}; + +const Object: React.FC = ({ title, description }) => { + return ( +
+
+
+

{title}

+

{description}

+
+
+ ); +}; + +export default Object; diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx new file mode 100644 index 0000000..cafb223 --- /dev/null +++ b/frontend/src/components/Sidebar.tsx @@ -0,0 +1,47 @@ +import React from "react"; +import Object from "./Object"; + +const Sidebar: React.FC = () => { + const items = JSON.parse(localStorage.getItem("allItems") || "[]"); + + return ( +