From 6c9e13d19af195f01f9c5b251524b325c4881f59 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Jul 2026 06:45:39 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20SMS=20city=20profiles=20UI=20=E2=80=94?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D1=81=D1=82=20=D1=86?= =?UTF-8?q?=D0=B2=D0=B5=D1=82=D0=BE=D0=B2,=20=D0=B2=D1=8B=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BD=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bg-[var(--color-surface-strong)] вместо --color-bg внутри карточек - Карточки профилей: --color-surface-strong, вложенные блоки: --color-surface - Текст всегда var(--color-text) — виден в светлой и тёмной теме - Toggle: компактнее (h-5 w-10) - Выравнивание: flex-wrap, gap, border-t для разделения секций - SMS ON/OFF badge вместо toggle в строке заголовка --- src/components/admin/SmsCityProfilesPanel.jsx | 148 +++++++++--------- 1 file changed, 75 insertions(+), 73 deletions(-) diff --git a/src/components/admin/SmsCityProfilesPanel.jsx b/src/components/admin/SmsCityProfilesPanel.jsx index 43d9671..d571a8d 100644 --- a/src/components/admin/SmsCityProfilesPanel.jsx +++ b/src/components/admin/SmsCityProfilesPanel.jsx @@ -147,9 +147,9 @@ export const SmsCityProfilesPanel = () => { // ── UI helpers ────────────────────────────────────────────────────────── const ModeBadge = ({ mode }) => { if (mode === "notification") { - return Уведомление; + return Уведомление; } - return Ссылка; + return Ссылка; }; const Toggle = ({ checked, onChange, label }) => ( @@ -157,15 +157,16 @@ export const SmsCityProfilesPanel = () => { - {label} + {label && {label}} ); - const modeLabel = (mode) => mode === "notification" ? "Уведомление без ссылки" : "Согласование по ссылке"; + const inputCls = "w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-strong)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"; + const cardCls = "rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-strong)] p-4 space-y-3"; return (
@@ -191,58 +192,58 @@ export const SmsCityProfilesPanel = () => { {showForm ? "Отмена" : "+ Профиль"}
- {message && {message}} + {message && {message}} {/* Add/Edit form */} {showForm && ( - +

{editingId ? "Редактировать профиль" : "Новый профиль города"}

- {/* City */} -
- - -
- - {/* SMS enabled master toggle */} -
- setFormSmsEnabled(!formSmsEnabled)} label="SMS включены для этого города" /> - {!formSmsEnabled && ( -

⚠ Все SMS в этот город отключены

- )} + {/* City + master toggle */} +
+
+ + +
+
+ setFormSmsEnabled(!formSmsEnabled)} label="SMS включены для города" /> + {!formSmsEnabled && ( +

⚠ Все SMS в этот город отключены

+ )} +
{/* Delivery */} -
+
📦 Доставка
{formDeliveryMode === "notification" && ( @@ -251,33 +252,33 @@ export const SmsCityProfilesPanel = () => { onChange={(e) => setFormDeliveryText(e.target.value)} placeholder="Ваш заказ готов. Доставим по графику." rows={2} - className="w-full rounded-xl border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] resize-none" + className={`${inputCls} resize-none`} /> )}

- {formDeliveryMode === "link" ? "Клиент получит ссылку для выбора даты доставки" : "Клиент получит уведомление — без согласования, без 2-й SMS"} + {formDeliveryMode === "link" ? "Клиент получит ссылку для выбора даты доставки" : "Уведомление без ссылки, без 2-й SMS"}

{/* Pickup */} -
+
🏪 Самовывоз
{formPickupMode === "notification" && ( @@ -286,18 +287,18 @@ export const SmsCityProfilesPanel = () => { onChange={(e) => setFormPickupText(e.target.value)} placeholder="Ваш заказ готов. Заберите со склада." rows={2} - className="w-full rounded-xl border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] resize-none" + className={`${inputCls} resize-none`} /> )}
{/* Toggles row */}
-
- setFormSecondSms(!formSecondSms)} label="2-я SMS (повторная отправка)" /> +
+ setFormSecondSms(!formSecondSms)} label="2-я SMS (повтор)" />
-
- setFormPaidStorage(!formPaidStorage)} label="SMS о платном хранении" /> +
+ setFormPaidStorage(!formPaidStorage)} label="SMS: платное хранение" />
@@ -309,7 +310,7 @@ export const SmsCityProfilesPanel = () => { value={formNote} onChange={(e) => setFormNote(e.target.value)} placeholder="Например: Ялта — доставка без согласования" - className="w-full rounded-xl border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]" + className={inputCls} />
@@ -340,28 +341,29 @@ export const SmsCityProfilesPanel = () => { ) : (
{profiles.map((p) => ( -
- {/* Header */} +
+ {/* Header row */}
-
+
{p.city} - handleQuickToggle(p, "sms_enabled")} label="" /> - {!p.sms_enabled && ( - SMS отключены + {!p.sms_enabled ? ( + SMS OFF + ) : ( + SMS ON )}
{/* Config grid */} -
+
{/* Delivery */} -
-
- 📦 Доставка: +
+
+ 📦 Доставка
{p.delivery_text && ( -

"{p.delivery_text}"

+

"{p.delivery_text}"

)}
{/* Pickup */} -
-
- 🏪 Самовывоз: +
+
+ 🏪 Самовывоз
{p.pickup_text && ( -

"{p.pickup_text}"

+

"{p.pickup_text}"

)}
- {/* Toggles */} -
- + {/* Toggles row */} +
+ 2-я SMS: {p.second_sms_enabled ? "✅" : "❌"} - + Платное хранение: {p.paid_storage_enabled ? "✅" : "❌"}
{p.note && ( -

💬 {p.note}

+

💬 {p.note}

)}
))}