From 56f6ce41c16e1cc408f0441ce9f4faa72d226560 Mon Sep 17 00:00:00 2001 From: Zotov Ivan Yuryevich Date: Sat, 4 Apr 2026 19:28:07 +0300 Subject: [PATCH] refactor: extract sections --- src/components/CategoryPage.tsx | 82 ---------------------- src/components/ContactModal.tsx | 8 +-- src/components/VendorCard.tsx | 38 ++++++++++ src/pages/[slug].astro | 4 +- src/pages/index.astro | 4 +- src/{components => sections}/About.tsx | 2 +- src/{components => sections}/Cases.tsx | 4 +- src/sections/CategoryPageHero.tsx | 33 +++++++++ src/{components => sections}/Contact.tsx | 2 +- src/{components => sections}/Footer.tsx | 10 +-- src/{components => sections}/Header.tsx | 4 +- src/{components => sections}/Hero.tsx | 4 +- src/{components => sections}/Services.tsx | 4 +- src/{components => sections}/Solutions.tsx | 4 +- src/sections/Vendors.tsx | 25 +++++++ src/views/CategoryView.tsx | 15 +++- src/views/HomePage.tsx | 12 ++-- 17 files changed, 139 insertions(+), 116 deletions(-) delete mode 100644 src/components/CategoryPage.tsx create mode 100644 src/components/VendorCard.tsx rename src/{components => sections}/About.tsx (98%) rename src/{components => sections}/Cases.tsx (95%) create mode 100644 src/sections/CategoryPageHero.tsx rename src/{components => sections}/Contact.tsx (98%) rename src/{components => sections}/Footer.tsx (93%) rename src/{components => sections}/Header.tsx (98%) rename src/{components => sections}/Hero.tsx (95%) rename src/{components => sections}/Services.tsx (95%) rename src/{components => sections}/Solutions.tsx (91%) create mode 100644 src/sections/Vendors.tsx diff --git a/src/components/CategoryPage.tsx b/src/components/CategoryPage.tsx deleted file mode 100644 index 144e5db..0000000 --- a/src/components/CategoryPage.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { ArrowLeft } from 'lucide-react' - -interface Vendor { - name: string - description: string - logo?: string - products?: string[] -} - -interface CategoryPageProps { - title: string - description: string - vendors: Vendor[] -} - -export function CategoryPage({ title, description, vendors }: CategoryPageProps) { - return ( -
- {/* Hero секция */} -
-
- - - Назад к главной - - -
-
-
- Каталог решений -
-

{title}

-

{description}

-
- -
-
-
-
- - {/* Список вендоров */} -
-
- {vendors.map((vendor, index) => ( -
-
-
-

{vendor.name}

-
- -

{vendor.description}

- - {vendor.products && vendor.products.length > 0 && ( -
-
Решения
-
- {vendor.products.map((product, idx) => ( - - {product} - - ))} -
-
- )} - - -
-
- ))} -
-
-
- ) -} diff --git a/src/components/ContactModal.tsx b/src/components/ContactModal.tsx index f095eda..cf42de3 100644 --- a/src/components/ContactModal.tsx +++ b/src/components/ContactModal.tsx @@ -23,11 +23,11 @@ export function ContactModal({ isOpen, onClose }: ContactModalProps) { const modalContent = (
e.stopPropagation()} > {/* Заголовок */} @@ -38,7 +38,7 @@ export function ContactModal({ isOpen, onClose }: ContactModalProps) {
@@ -156,7 +156,7 @@ export function ContactModal({ isOpen, onClose }: ContactModalProps) { {/* Слоты для встречи в ВКС */}
-