Refactor layout components to include title prop and update header rendering; modify index and home pages for improved structure and icon usage

This commit is contained in:
2025-08-11 20:10:36 +02:00
parent 11384103c9
commit 97eaf1e484
6 changed files with 25 additions and 16 deletions

View File

@@ -1,9 +1,13 @@
import "../App.css";
import Layout from "../layout/Layout";
import React from "react";
const Admin: React.FC = () => {
return (
<>
<h1>Admin</h1>
<Layout title="MCS Lose - Admin Panel">
<h1>Admin</h1>
</Layout>
</>
);
};

View File

@@ -1,14 +1,18 @@
import React from "react";
import { Award, RectangleEllipsis } from "lucide-react";
import { Ticket, RectangleEllipsis } from "lucide-react";
const Header: React.FC = () => {
type HeaderProps = {
title: string;
};
const Header: React.FC<HeaderProps> = ({ title }) => {
return (
<header className="w-full border-b border-black/10 bg-gray-100/95 shadow-sm">
<div className="mx-auto flex max-w-7xl items-center justify-between px-4 py-3 md:px-6">
<div className="flex items-center gap-3">
<Award className="h-8 w-8 text-black" strokeWidth={2.6} />
<Ticket className="h-8 w-8 text-black" strokeWidth={2.6} />
<h1 className="text-2xl font-black tracking-tight text-neutral-900 md:text-3xl">
MCS Lose
{title}
</h1>
</div>
<a href="/admin">

View File

@@ -1,16 +1,16 @@
import "../App.css";
import Layout from "../layout/Layout";
import MainForm from "./MainForm";
import "react-toastify/dist/ReactToastify.css";
import React from "react";
function App() {
const Home: React.FC = () => {
return (
<>
<Layout>
<Layout title="MCS Lose - Registrieren">
<MainForm />
</Layout>
</>
);
}
};
export default App;
export default Home;

View File

@@ -122,7 +122,7 @@ const MainForm: React.FC = () => {
type="submit"
className="mt-2 w-full rounded-xl bg-blue-600 px-4 py-3 text-base font-bold text-white shadow transition hover:bg-blue-700 active:bg-blue-800"
>
Los Registrieren
Los registrieren
</button>
<p className="mt-1 text-xs text-zinc-500">
Wenn Sie die Daten eines Loses bearbeiten möchten,{" "}

View File

@@ -4,13 +4,14 @@ import "../App.css";
import { ToastContainer } from "react-toastify";
type LayoutProps = {
children: React.ReactNode;
children: React.ReactNode,
title: string
};
const Layout: React.FC<LayoutProps> = ({ children }) => {
const Layout: React.FC<LayoutProps> = ({ children, title }) => {
return (
<>
<Header />
<Header title={title} />
<main>{children}</main>
<footer></footer>
<ToastContainer