feat(vorlagen): Editor, Liste und Versionsgeschichte (#24)
This commit was merged in pull request #24.
This commit is contained in:
@@ -22,6 +22,9 @@ import { darf } from "@/server/auth/rollen";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { versionText } from "@/lib/version";
|
||||
|
||||
/** Wird in #014 auf `true` gestellt, zusammen mit der Seite. */
|
||||
const SCANNEN_VERFUEGBAR = false;
|
||||
|
||||
const SYMBOLE: Record<string, LucideIcon> = {
|
||||
LayoutDashboard,
|
||||
ListChecks,
|
||||
@@ -90,15 +93,46 @@ function NavZeile({ eintrag, aktiv }: { eintrag: NavEintrag; aktiv: boolean }) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Der Einstieg des Technikers, an beiden Stellen ganz oben.
|
||||
*
|
||||
* Solange es `/scannen` nicht gibt (#014), wird **nicht** verlinkt: ein Knopf,
|
||||
* der so prominent sitzt, darf nicht auf eine Fehlerseite fuehren. Next holt den
|
||||
* Verweis beim Darueberfahren sogar vorab — jede Seite erzeugte damit eine 404
|
||||
* im Hintergrund. Dieselbe Regel gilt schon fuer die Navigation.
|
||||
*/
|
||||
function ScannenKnopf({ className }: { className?: string }) {
|
||||
// Pille statt der shadcn-Vorgabe rounded-lg, und 44 px am Handy / 40 px am
|
||||
// Schreibtisch statt 32 px – so verlangt es die Gestaltungsvorgabe.
|
||||
const gemeinsam = cn("h-11 gap-2 rounded-pille px-4 text-sm font-semibold md:h-10", className);
|
||||
const inhalt = (
|
||||
<>
|
||||
<ScanLine className="size-[18px]" strokeWidth={2} aria-hidden="true" />
|
||||
Scannen
|
||||
</>
|
||||
);
|
||||
|
||||
if (!SCANNEN_VERFUEGBAR) {
|
||||
// Nicht als abgeblendeter Akzentknopf – das sieht aus wie ein Fehler. Die
|
||||
// gedaempfte Form ist dieselbe, die die Navigation fuer noch fehlende Seiten
|
||||
// benutzt.
|
||||
return (
|
||||
<span
|
||||
title="Kommt mit #014"
|
||||
aria-disabled="true"
|
||||
className={cn(
|
||||
gemeinsam,
|
||||
"flex cursor-not-allowed items-center justify-center border border-linie text-nebentext/60",
|
||||
)}
|
||||
>
|
||||
{inhalt}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
// Pille statt der shadcn-Vorgabe rounded-lg, und 44 px am Handy / 40 px am
|
||||
// Schreibtisch statt 32 px – so verlangt es die Gestaltungsvorgabe.
|
||||
<Button asChild className={cn("h-11 gap-2 rounded-pille px-4 text-sm font-semibold md:h-10", className)}>
|
||||
<Link href="/scannen">
|
||||
<ScanLine className="size-[18px]" strokeWidth={2} aria-hidden="true" />
|
||||
Scannen
|
||||
</Link>
|
||||
<Button asChild className={gemeinsam}>
|
||||
<Link href="/scannen">{inhalt}</Link>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user