Compare commits

..
Author SHA1 Message Date
Rudi c71df05598 Responsive design for Sender-page 2026-10-13 21:46:42 +02:00
5 changed files with 33 additions and 61 deletions

No files matched your search

+3 -2
View File
@@ -26,10 +26,11 @@ export default function RootLayout({
}>) {
return (
<html lang="de">
<body className="min-h-screen flex flex-col">
<body className="min-h-screen min-w-80 flex flex-col">
<Header />
<main className="mt-20 mx-auto min-w-200 max-w-full">{children}</main>
<main className="mt-28 sm:mt-20 mx-auto w-full max-w-6xl px-4 sm:px-6 lg:px-8">{children}</main>
</body>
</html>
+23 -52
View File
@@ -56,86 +56,57 @@ function Songs({ actionName, onSelectSong, songBooks, className = "", ...props }
.filter((g) => g.songs.length > 0);
}, [books, query]);
const th = "p-3 text-xs font-semibold text-neutral-600 dark:text-neutral-400 uppercase tracking-wider";
return (
<Card
{...props}
title="Alle Lieder"
className={`h-[500px] ${className}`}
>
<div className="mb-4">
<Card {...props} title="Alle Lieder" className={className}>
<div className="mb-3">
<Input.Text
type="text"
placeholder="Nach Songtitel, Nummer oder Liederbuch suchen..."
placeholder="Titel, Nummer oder Liederbuch suchen..."
value={query}
onChange={(e) => setQuery(e.target.value)}
/>
</div>
<div className="flex-1 min-h-0 overflow-auto border border-neutral-200 dark:border-neutral-800 rounded-lg bg-white dark:bg-black">
<table className="w-full text-left border-collapse text-sm">
<thead className="bg-neutral-100 dark:bg-neutral-900 sticky top-0 border-b border-neutral-200 dark:border-neutral-800 z-10">
<tr>
<th className={`${th} w-24 text-center`}>Nummer</th>
<th className={th}>Titel</th>
<th className={`${th} text-right`}>Aktion</th>
</tr>
</thead>
<div className="max-h-[65vh] overflow-y-auto border border-neutral-200 dark:border-neutral-800 rounded-lg bg-white dark:bg-black">
{groups.length === 0 ? (
<tbody>
<tr>
<td colSpan={3} className="p-8 text-center text-neutral-400 dark:text-neutral-500">
<p className="p-8 text-center text-neutral-400 dark:text-neutral-500">
Keine Lieder gefunden
</td>
</tr>
</tbody>
</p>
) : (
groups.map(({ book, songs }) => (
<tbody key={book.id} className="divide-y divide-neutral-200 dark:divide-neutral-800">
<tr className="bg-neutral-50 dark:bg-neutral-950">
<th
colSpan={3}
className="p-3 text-sm font-bold text-neutral-900 dark:text-white border-y border-neutral-200 dark:border-neutral-800"
>
<section key={book.id}>
<h3 className="sticky top-0 z-10 px-3 py-2 text-sm font-bold bg-neutral-100 dark:bg-neutral-900 text-neutral-900 dark:text-white border-y border-neutral-200 dark:border-neutral-800">
{book.title}
{book.language && (
<span className="ml-2 text-xs font-normal text-neutral-500 dark:text-neutral-400">
<span className="ml-2 text-xs font-normal text-neutral-500">
({book.language})
</span>
)}
</th>
</tr>
</h3>
<ul className="divide-y divide-neutral-200 dark:divide-neutral-800">
{songs.map((entry) => (
<tr
<li
key={`${book.id}-${entry.song.id}`}
className="hover:bg-neutral-100/60 dark:hover:bg-neutral-900/40 transition"
className="flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2.5"
>
<td className="p-3 text-center font-mono text-blue-600 dark:text-blue-400 font-bold">
<span className="w-12 shrink-0 text-center font-mono font-bold text-blue-600 dark:text-blue-400">
{entry.songNumber}
</td>
<td className="p-3 font-medium text-neutral-900 dark:text-white">
</span>
<span className="flex-1 min-w-40 break-words font-medium text-neutral-900 dark:text-white">
{entry.song.title}
</td>
<td className="p-3 text-right">
</span>
<Input.Button
onClick={() =>
onSelectSong?.(
entry.song,
{ id: book.id, title: book.title },
String(entry.songNumber)
)
}
className="bg-white dark:bg-black hover:bg-blue-600 dark:hover:bg-blue-600 border border-neutral-300 dark:border-neutral-700 hover:border-blue-600 dark:hover:border-blue-500 hover:text-white font-medium rounded-md px-3 py-1.5 transition text-xs"
onClick={() => onSelectSong?.(entry.song, { id: book.id, title: book.title }, String(entry.songNumber))}
className="shrink-0 w-auto px-3 py-2 text-xs"
>
{actionName}
</Input.Button>
</td>
</tr>
</li>
))}
</tbody>
</ul>
</section>
))
)}
</table>
</div>
</Card>
)
+1 -1
View File
@@ -17,7 +17,7 @@ export default function Card({ title, hasLeftBorder = false, children, className
</h2>
{/* border-l-2 fügt den Strich links ein, pl-4 macht Platz zum Inhalt */}
<div className={`flex-1 min-h-0 flex flex-col border-neutral-200 dark:border-neutral-800 ${hasLeftBorder ? "border-l-2 pl-4}" : ""}`}>
<div className={`flex-1 min-h-0 flex flex-col border-neutral-200 dark:border-neutral-800 ${hasLeftBorder ? "border-l-2 pl-4" : ""}`}>
{children}
</div>
</section>
+4 -4
View File
@@ -36,13 +36,13 @@ function File({ ...props }: ComponentPropsWithoutRef<"input">) {
);
}
function Button({ children, ...props }: ComponentPropsWithoutRef<"button">) {
function Button({ children, className = "", ...props }: ComponentPropsWithoutRef<"button">) {
return (
<button
className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
{...props}
className={`bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm ${className || "w-full"}`}
{...props}
>
{children}
{children}
</button>
)
}
+2 -2
View File
@@ -2,9 +2,9 @@ import NavItem from "./NavItem";
export default function Header() {
return (
<header className="fixed top-0 left-0 w-full z-50 p-4 flex justify-between items-center backdrop-blur-md border-b-2 border-slate-500">
<header className="fixed top-0 left-0 w-full min-w-80 z-50 p-3 sm:p-4 flex flex-wrap gap-2 justify-between items-center backdrop-blur-md border-b-2 border-slate-500">
<div className="font-bold text-xl">PsalmTafel</div>
<nav className="flex gap-4 border-2 rounded-full">
<nav className="flex flex-wrap gap-1 sm:gap-4 border-2 rounded-full text-sm">
<NavItem path="/dashboard">Dashboard</NavItem>
<NavItem path="/sender">Sender</NavItem>
<NavItem path="/receiver">Empfänger</NavItem>