fix: react-doctor modal/dialog/dropzone a11y — 18 files to role+tabIndex+onKeyDown or dialog
This commit is contained in:
@@ -236,7 +236,12 @@ export default function AnalyticsDashboard({ analytics }: Props) {
|
||||
const campaignCount = filteredAnalytics.length;
|
||||
|
||||
// Best performing campaign
|
||||
const bestCampaign = [...filteredAnalytics].sort((a, b) => Number(b.open_rate) - Number(a.open_rate))[0];
|
||||
let bestCampaign: (typeof filteredAnalytics)[number] | undefined;
|
||||
for (const a of filteredAnalytics) {
|
||||
if (!bestCampaign || Number(a.open_rate) > Number(bestCampaign.open_rate)) {
|
||||
bestCampaign = a;
|
||||
}
|
||||
}
|
||||
|
||||
const emptyStateIcon = Icons.chart("w-10 h-10");
|
||||
|
||||
|
||||
@@ -391,7 +391,10 @@ function FilterBlock({ brandId, filter, onChange, onRemove }: FilterBlockProps)
|
||||
onChange({
|
||||
params: {
|
||||
...filter.params,
|
||||
zip_codes: e.target.value.split(",").map((z) => z.trim()).filter(Boolean),
|
||||
zip_codes: e.target.value.split(",").flatMap((z) => {
|
||||
const trimmed = z.trim();
|
||||
return trimmed ? [trimmed] : [];
|
||||
}),
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -446,7 +449,10 @@ function FilterBlock({ brandId, filter, onChange, onRemove }: FilterBlockProps)
|
||||
onChange({
|
||||
params: {
|
||||
...filter.params,
|
||||
tags: e.target.value.split(",").map((t) => t.trim()).filter(Boolean),
|
||||
tags: e.target.value.split(",").flatMap((t) => {
|
||||
const trimmed = t.trim();
|
||||
return trimmed ? [trimmed] : [];
|
||||
}),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -41,8 +41,10 @@ export default function SegmentEditModal({ initialName = "", initialDescription
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
||||
{/* Backdrop */}
|
||||
<div
|
||||
className="absolute inset-0 bg-black/50 backdrop-blur-sm"
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Close modal"
|
||||
className="absolute inset-0 bg-black/50 backdrop-blur-sm border-0 p-0 cursor-default"
|
||||
onClick={onClose}
|
||||
/>
|
||||
|
||||
@@ -82,7 +84,6 @@ export default function SegmentEditModal({ initialName = "", initialDescription
|
||||
onKeyDown={(e) => e.key === "Enter" && handleSave()}
|
||||
placeholder="e.g. Fort Pierce Regulars"
|
||||
className="w-full border border-[var(--admin-border)] rounded-lg px-3 py-2.5 text-sm bg-white text-[var(--admin-text-primary)] focus:ring-2 focus:ring-[var(--admin-accent)] focus:border-[var(--admin-accent)] outline-none"
|
||||
autoFocus
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user