From 46fac18e28c205089465e531dd36c3a85c05fd84 Mon Sep 17 00:00:00 2001 From: Hermes Date: Wed, 19 Aug 2026 12:36:27 +0200 Subject: [PATCH] =?UTF-8?q?ui:=20restructure=20filters=20=E2=80=94=20searc?= =?UTF-8?q?h=20wider=20on=20row=201,=20SMS=20+=20hide-completed=20toggle?= =?UTF-8?q?=20switch=20on=20row=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UI/Switch.jsx | 38 ++++++++++++++++++++ src/components/orders/OrderFilters.jsx | 49 ++++++++++++-------------- 2 files changed, 60 insertions(+), 27 deletions(-) create mode 100644 src/components/UI/Switch.jsx diff --git a/src/components/UI/Switch.jsx b/src/components/UI/Switch.jsx new file mode 100644 index 0000000..1de7fed --- /dev/null +++ b/src/components/UI/Switch.jsx @@ -0,0 +1,38 @@ +import React from "react"; + +/** + * Accessible iOS-style toggle switch. + * @param {object} props + * @param {boolean} props.checked + * @param {function} props.onChange Called with the next boolean value. + * @param {string} [props.label] Visible text next to the switch. + * @param {string} [props.title] Hover tooltip. + * @param {string} [props.className] + */ +export const Switch = ({ checked = false, onChange, label, title, className = "" }) => { + const id = React.useId(); + return ( + + ); +}; diff --git a/src/components/orders/OrderFilters.jsx b/src/components/orders/OrderFilters.jsx index 359657a..bd5c893 100644 --- a/src/components/orders/OrderFilters.jsx +++ b/src/components/orders/OrderFilters.jsx @@ -3,6 +3,7 @@ import { Button } from "../UI/Button"; import { Input } from "../UI/Input"; import { Panel } from "../UI/Panel"; import { DatePicker } from "../UI/DatePicker"; +import { Switch } from "../UI/Switch"; const DropdownSelect = ({ value, options, onChange, placeholder }) => { const [isOpen, setIsOpen] = React.useState(false); @@ -129,8 +130,8 @@ export const OrderFilters = ({ filters, setFilters, statusOptions = [], cities = return (
- {/* Row 1: Status + City + DeliveryType + Search */} -
+ {/* Row 1: Status + City + DeliveryType + Search (search spans wider) */} +
- {/* Row 2: Date range */} -
+ {/* Row 2: Date range + SMS problems (width matches its text) + hide-completed toggle */} +
updateFilter("dateFrom", v)} @@ -252,6 +230,23 @@ export const OrderFilters = ({ filters, setFilters, statusOptions = [], cities = ✕ Сбросить )} + + updateFilter("smsStatus", v)} + placeholder="Проблемы SMS" + /> + + {typeof onToggleHideCompleted === "function" && ( + + )}