fix: react-doctor modal/dialog/dropzone a11y — 18 files to role+tabIndex+onKeyDown or dialog
This commit is contained in:
@@ -273,11 +273,12 @@ export default function WaterLogAdminPanel({
|
||||
|
||||
async function handlePreviewReport() {
|
||||
const all = await getWaterEntries(brandId, 1000);
|
||||
const todayRows: WaterLogReportRow[] = all
|
||||
.filter(
|
||||
(e) => (e.logged_date ?? e.logged_at.slice(0, 10)) === today,
|
||||
)
|
||||
.map(shapeWaterLogEntry);
|
||||
const todayRows: WaterLogReportRow[] = [];
|
||||
for (const e of all) {
|
||||
if ((e.logged_date ?? e.logged_at.slice(0, 10)) === today) {
|
||||
todayRows.push(shapeWaterLogEntry(e));
|
||||
}
|
||||
}
|
||||
const report = formatDailyWaterReport(todayRows, {
|
||||
recipientName: recipientName || undefined,
|
||||
previewMode: true,
|
||||
@@ -489,7 +490,6 @@ export default function WaterLogAdminPanel({
|
||||
onChange={(v) => setNewHg((s) => ({ ...s, name: v }))}
|
||||
placeholder="e.g. North Field Gate 1"
|
||||
required
|
||||
autoFocus
|
||||
/>
|
||||
<Select
|
||||
label="Unit"
|
||||
@@ -657,7 +657,6 @@ export default function WaterLogAdminPanel({
|
||||
onChange={(v) => setNewUser((s) => ({ ...s, name: v }))}
|
||||
placeholder="Full name"
|
||||
required
|
||||
autoFocus
|
||||
/>
|
||||
<Select
|
||||
label="Role"
|
||||
@@ -1116,7 +1115,6 @@ function Input({
|
||||
onChange,
|
||||
placeholder,
|
||||
required,
|
||||
autoFocus,
|
||||
type = "text",
|
||||
}: {
|
||||
label: string;
|
||||
@@ -1124,7 +1122,6 @@ function Input({
|
||||
onChange: (v: string) => void;
|
||||
placeholder?: string;
|
||||
required?: boolean;
|
||||
autoFocus?: boolean;
|
||||
type?: string;
|
||||
}) {
|
||||
return (
|
||||
@@ -1138,7 +1135,6 @@ function Input({
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
placeholder={placeholder}
|
||||
required={required}
|
||||
autoFocus={autoFocus}
|
||||
className="w-full rounded-lg border border-[#d4d9d3] bg-white px-3 py-2 text-sm text-[#1d1d1f] outline-none transition focus:border-[#1a4d2e] focus:ring-2 focus:ring-[#1a4d2e]/15"
|
||||
/>
|
||||
</label>
|
||||
@@ -1199,8 +1195,7 @@ function FilterChip({ label, children }: { label: string; children: React.ReactN
|
||||
function Avatar({ name, role }: { name: string; role: string }) {
|
||||
const initials = name
|
||||
.split(/\s+/)
|
||||
.map((n) => n[0])
|
||||
.filter(Boolean)
|
||||
.flatMap((n) => (n[0] ? [n[0]] : []))
|
||||
.slice(0, 2)
|
||||
.join("")
|
||||
.toUpperCase();
|
||||
|
||||
Reference in New Issue
Block a user