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 36 additions and 64 deletions

No files matched your search

+3 -2
View File
@@ -26,10 +26,11 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang="de"> <html lang="de">
<body className="min-h-screen flex flex-col"> <body className="min-h-screen min-w-80 flex flex-col">
<Header /> <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> </body>
</html> </html>
+23 -52
View File
@@ -56,86 +56,57 @@ function Songs({ actionName, onSelectSong, songBooks, className = "", ...props }
.filter((g) => g.songs.length > 0); .filter((g) => g.songs.length > 0);
}, [books, query]); }, [books, query]);
const th = "p-3 text-xs font-semibold text-neutral-600 dark:text-neutral-400 uppercase tracking-wider";
return ( return (
<Card <Card {...props} title="Alle Lieder" className={className}>
{...props} <div className="mb-3">
title="Alle Lieder"
className={`h-[500px] ${className}`}
>
<div className="mb-4">
<Input.Text <Input.Text
type="text" type="text"
placeholder="Nach Songtitel, Nummer oder Liederbuch suchen..." placeholder="Titel, Nummer oder Liederbuch suchen..."
value={query} value={query}
onChange={(e) => setQuery(e.target.value)} onChange={(e) => setQuery(e.target.value)}
/> />
</div> </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"> <div className="max-h-[65vh] overflow-y-auto border border-neutral-200 dark:border-neutral-800 rounded-lg bg-white dark:bg-black">
<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>
{groups.length === 0 ? ( {groups.length === 0 ? (
<tbody> <p className="p-8 text-center text-neutral-400 dark:text-neutral-500">
<tr>
<td colSpan={3} className="p-8 text-center text-neutral-400 dark:text-neutral-500">
Keine Lieder gefunden Keine Lieder gefunden
</td> </p>
</tr>
</tbody>
) : ( ) : (
groups.map(({ book, songs }) => ( groups.map(({ book, songs }) => (
<tbody key={book.id} className="divide-y divide-neutral-200 dark:divide-neutral-800"> <section key={book.id}>
<tr className="bg-neutral-50 dark:bg-neutral-950"> <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">
<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"
>
{book.title} {book.title}
{book.language && ( {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}) ({book.language})
</span> </span>
)} )}
</th> </h3>
</tr> <ul className="divide-y divide-neutral-200 dark:divide-neutral-800">
{songs.map((entry) => ( {songs.map((entry) => (
<tr <li
key={`${book.id}-${entry.song.id}`} 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} {entry.songNumber}
</td> </span>
<td className="p-3 font-medium text-neutral-900 dark:text-white"> <span className="flex-1 min-w-40 break-words font-medium text-neutral-900 dark:text-white">
{entry.song.title} {entry.song.title}
</td> </span>
<td className="p-3 text-right">
<Input.Button <Input.Button
onClick={() => onClick={() => onSelectSong?.(entry.song, { id: book.id, title: book.title }, String(entry.songNumber))}
onSelectSong?.( className="shrink-0 w-auto px-3 py-2 text-xs"
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"
> >
{actionName} {actionName}
</Input.Button> </Input.Button>
</td> </li>
</tr>
))} ))}
</tbody> </ul>
</section>
)) ))
)} )}
</table>
</div> </div>
</Card> </Card>
) )
+2 -2
View File
@@ -17,9 +17,9 @@ export default function Card({ title, hasLeftBorder = false, children, className
</h2> </h2>
{/* border-l-2 fügt den Strich links ein, pl-4 macht Platz zum Inhalt */} {/* 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} {children}
</div> </div>
</section> </section>
); );
} }
+5 -5
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 ( return (
<button <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" 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} {...props}
> >
{children} {children}
</button> </button>
) )
} }
@@ -61,4 +61,4 @@ export const Input = {
File: File, File: File,
Button: Button, Button: Button,
Label: Label, Label: Label,
}; };
+3 -3
View File
@@ -2,9 +2,9 @@ import NavItem from "./NavItem";
export default function Header() { export default function Header() {
return ( 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> <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="/dashboard">Dashboard</NavItem>
<NavItem path="/sender">Sender</NavItem> <NavItem path="/sender">Sender</NavItem>
<NavItem path="/receiver">Empfänger</NavItem> <NavItem path="/receiver">Empfänger</NavItem>
@@ -12,4 +12,4 @@ export default function Header() {
</nav> </nav>
</header> </header>
); );
} }