The hero used 100dvh, which grows once the phone browser has hidden its address and bottom bars after a scroll. The hero then became ~110px taller and pushed the stats strip and everything below it down, right while the stats were fading in. 100svh stays fixed at the bars-shown height, so the hero still fills the first screen on load but no longer resizes afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 line
4.2 KiB
JavaScript
1 line
4.2 KiB
JavaScript
import{r as l,j as e,L as k,a as n}from"./index-CeNRYcbS.js";import{I as N}from"./ImageUploadField-DZzU8Hmm.js";import{T as f}from"./TextStyleWidget-DErOyFHL.js";const u={name:"",image_path:"",sort_order:0};function _(){const[i,h]=l.useState([]),[r,s]=l.useState(u),[a,o]=l.useState(null),[c,m]=l.useState(""),d=()=>n.get("/brands").then(h);l.useEffect(()=>{d()},[]);const p=t=>{o(t.id),s({name:t.name,image_path:t.image_path||"",sort_order:t.sort_order})},x=()=>{o(null),s(u)},b=async t=>{t.preventDefault(),m("");try{a?await n.put(`/brands/${a}`,r):await n.post("/brands",r),x(),d()}catch(j){m(j.message)}},g=async t=>{confirm("Marke inkl. aller Modelle/Pakete/Produkte wirklich löschen?")&&(await n.delete(`/brands/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Marken"}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Bild"}),e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[i.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsx("td",{className:"px-4 py-2",children:t.image_path?e.jsx("img",{src:t.image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):e.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),e.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:e.jsx(k,{to:`/marken/${t.slug}`,target:"_blank",className:"hover:text-brand-500",children:t.name})}),e.jsx("td",{className:"px-4 py-2",children:t.sort_order}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>p(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>g(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),i.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Marken angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:b,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:a?"Marke bearbeiten":"Neue Marke"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>s({...r,name:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a&&e.jsx(f,{fieldKey:`brands.${a}.name`,previewText:r.name||"Beispieltext"})]}),e.jsx(N,{value:r.image_path,onChange:t=>s({...r,image_path:t}),label:"Bild (optional)"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),e.jsx("input",{type:"number",value:r.sort_order,onChange:t=>s({...r,sort_order:Number(t.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c&&e.jsx("p",{className:"text-sm text-red-600",children:c}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:a?"Speichern":"Anlegen"}),a&&e.jsx("button",{type:"button",onClick:x,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{_ as default};
|