From 6c485872b03df6db27f1e6dcc5b8354f71674ace Mon Sep 17 00:00:00 2001 From: "diana.dolgolyova" Date: Wed, 25 Mar 2026 23:48:06 +0300 Subject: [PATCH] feat: centralize popup texts in new admin tab /admin/popups - New admin page for shared popup texts (success, waiting list, error, Instagram hint) - Removed popup fields from MC and Open Day admin editors - All SignupModals now read from centralized popups config - Stored as "popups" section in DB with fallback defaults --- src/app/admin/layout.tsx | 2 + src/app/admin/master-classes/page.tsx | 17 ------- src/app/admin/open-day/page.tsx | 25 ---------- src/app/admin/popups/page.tsx | 56 +++++++++++++++++++++++ src/app/page.tsx | 4 +- src/components/sections/MasterClasses.tsx | 9 ++-- src/components/sections/OpenDay.tsx | 10 ++-- src/components/ui/SignupModal.tsx | 10 +++- src/data/content.ts | 6 +++ src/lib/db.ts | 15 +++--- src/types/content.ts | 8 +++- 11 files changed, 100 insertions(+), 62 deletions(-) create mode 100644 src/app/admin/popups/page.tsx diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx index 2431720..efcd463 100644 --- a/src/app/admin/layout.tsx +++ b/src/app/admin/layout.tsx @@ -23,6 +23,7 @@ import { ChevronLeft, ClipboardList, DoorOpen, + MessageSquare, } from "lucide-react"; const NAV_ITEMS = [ @@ -39,6 +40,7 @@ const NAV_ITEMS = [ { href: "/admin/pricing", label: "Цены", icon: DollarSign }, { href: "/admin/faq", label: "FAQ", icon: HelpCircle }, { href: "/admin/news", label: "Новости", icon: Newspaper }, + { href: "/admin/popups", label: "Всплывающие окна", icon: MessageSquare }, { href: "/admin/contact", label: "Контакты", icon: Phone }, ]; diff --git a/src/app/admin/master-classes/page.tsx b/src/app/admin/master-classes/page.tsx index e56a80b..bc9e71c 100644 --- a/src/app/admin/master-classes/page.tsx +++ b/src/app/admin/master-classes/page.tsx @@ -34,8 +34,6 @@ function PriceField({ label, value, onChange, placeholder }: { label: string; va interface MasterClassesData { title: string; - successMessage?: string; - waitingListText?: string; items: MasterClassItem[]; } @@ -386,21 +384,6 @@ export default function MasterClassesEditorPage() { onChange={(v) => update({ ...data, title: v })} /> - update({ ...data, successMessage: v || undefined })} - placeholder="Вы записаны! Мы свяжемся с вами" - /> - - update({ ...data, waitingListText: v || undefined })} - placeholder="Все места заняты, но мы добавили вас в лист ожидания..." - rows={2} - /> - -
-
- -