diff --git a/public/images/resource2.png b/public/images/resource2.png new file mode 100644 index 0000000..49cfef2 Binary files /dev/null and b/public/images/resource2.png differ diff --git a/src/components/BottomHead.tsx b/src/components/BottomHead.tsx index 64df85c..e24ca25 100644 --- a/src/components/BottomHead.tsx +++ b/src/components/BottomHead.tsx @@ -227,41 +227,63 @@ const BottomHead = ({ menuOpen, onClose }: { menuOpen: boolean; onClose: () => v {mobileCategory.label}
- {mobileCategory.links.map((link: string, linkIndex: number) => ( + {mobileCategory.links.length === 1 ? (
{ - // Ищем соответствующую подгруппу по названию - let subcategoryId = `${mobileCategory.catalogId}_${linkIndex}`; - + let subcategoryId = `${mobileCategory.catalogId}_0`; if (mobileCategory.groups) { for (const group of mobileCategory.groups) { - // Проверяем в подгруппах if (group.subgroups && group.subgroups.length > 0) { - const foundSubgroup = group.subgroups.find((subgroup: any) => subgroup.name === link); + const foundSubgroup = group.subgroups.find((subgroup: any) => subgroup.name === mobileCategory.links[0]); if (foundSubgroup) { subcategoryId = foundSubgroup.id; break; } - } - // Если нет подгрупп, проверяем саму группу - else if (group.name === link) { + } else if (group.name === mobileCategory.links[0]) { subcategoryId = group.id; break; } } } - - // Получаем catalogId из данных const activeCatalog = catalogsData?.partsIndexCategoriesWithGroups?.[tabData.findIndex(tab => tab === mobileCategory)]; const catalogId = activeCatalog?.id || 'fallback'; - handleCategoryClick(catalogId, link, subcategoryId); + handleCategoryClick(catalogId, mobileCategory.links[0], subcategoryId); }} + style={{ cursor: "pointer" }} > - {link} + Показать все
- ))} + ) : ( + mobileCategory.links.map((link: string, linkIndex: number) => ( +
{ + let subcategoryId = `${mobileCategory.catalogId}_${linkIndex}`; + if (mobileCategory.groups) { + for (const group of mobileCategory.groups) { + if (group.subgroups && group.subgroups.length > 0) { + const foundSubgroup = group.subgroups.find((subgroup: any) => subgroup.name === link); + if (foundSubgroup) { + subcategoryId = foundSubgroup.id; + break; + } + } else if (group.name === link) { + subcategoryId = group.id; + break; + } + } + } + const activeCatalog = catalogsData?.partsIndexCategoriesWithGroups?.[tabData.findIndex(tab => tab === mobileCategory)]; + const catalogId = activeCatalog?.id || 'fallback'; + handleCategoryClick(catalogId, link, subcategoryId); + }} + > + {link} +
+ )) + )}
) : ( @@ -443,44 +465,66 @@ const BottomHead = ({ menuOpen, onClose }: { menuOpen: boolean; onClose: () => v

{tab.heading}

- {tab.links.map((link, linkIndex) => { - const catalog = catalogsData?.partsIndexCategoriesWithGroups?.[idx]; - - // Ищем соответствующую подгруппу по названию - let subcategoryId = `fallback_${idx}_${linkIndex}`; - - if (catalog?.groups) { - for (const group of catalog.groups) { - // Проверяем в подгруппах - if (group.subgroups && group.subgroups.length > 0) { - const foundSubgroup = group.subgroups.find((subgroup: any) => subgroup.name === link); - if (foundSubgroup) { - subcategoryId = foundSubgroup.id; + {tab.links.length === 1 ? ( +
{ + const catalog = catalogsData?.partsIndexCategoriesWithGroups?.[idx]; + let subcategoryId = `fallback_${idx}_0`; + if (catalog?.groups) { + for (const group of catalog.groups) { + if (group.subgroups && group.subgroups.length > 0) { + const foundSubgroup = group.subgroups.find((subgroup: any) => subgroup.name === tab.links[0]); + if (foundSubgroup) { + subcategoryId = foundSubgroup.id; + break; + } + } else if (group.name === tab.links[0]) { + subcategoryId = group.id; + break; + } + } + } + const catalogId = catalog?.id || 'fallback'; + handleCategoryClick(catalogId, tab.links[0], subcategoryId); + }} + style={{ cursor: "pointer" }} + > + Показать все +
+ ) : ( + tab.links.map((link: string, linkIndex: number) => { + const catalog = catalogsData?.partsIndexCategoriesWithGroups?.[idx]; + let subcategoryId = `fallback_${idx}_${linkIndex}`; + if (catalog?.groups) { + for (const group of catalog.groups) { + if (group.subgroups && group.subgroups.length > 0) { + const foundSubgroup = group.subgroups.find((subgroup: any) => subgroup.name === link); + if (foundSubgroup) { + subcategoryId = foundSubgroup.id; + break; + } + } else if (group.name === link) { + subcategoryId = group.id; break; } } - // Если нет подгрупп, проверяем саму группу - else if (group.name === link) { - subcategoryId = group.id; - break; - } } - } - - return ( -
{ - const catalogId = catalog?.id || 'fallback'; - handleCategoryClick(catalogId, link, subcategoryId); - }} - style={{ cursor: "pointer" }} - > - {link} -
- ); - })} + return ( +
{ + const catalogId = catalog?.id || 'fallback'; + handleCategoryClick(catalogId, link, subcategoryId); + }} + style={{ cursor: "pointer" }} + > + {link} +
+ ); + }) + )}
diff --git a/src/components/CatalogSubscribe.tsx b/src/components/CatalogSubscribe.tsx index 6fca15a..79ad118 100644 --- a/src/components/CatalogSubscribe.tsx +++ b/src/components/CatalogSubscribe.tsx @@ -1,10 +1,16 @@ -import React from "react"; +import React, { useState } from "react"; const CatalogSubscribe: React.FC = () => (
+ Ресурс 2
-

Подпишитесь на новостную рассылку

+ {/*

Подпишитесь на новостную рассылку

*/} +
Оставайтесь в курсе акций,
новинок и специальных предложений
@@ -13,6 +19,38 @@ const CatalogSubscribe: React.FC = () => (
+
+ {/* Кастомный чекбокс без input/label */} + {(() => { + const [checked, setChecked] = useState(false); + return ( + <> +
setChecked(v => !v)} + role="checkbox" + aria-checked={checked} + tabIndex={0} + onKeyDown={e => { if (e.key === ' ' || e.key === 'Enter') setChecked(v => !v); }} + > + + + +
+ + Я даю свое согласие на обработку персональных данных
+ и соглашаюсь с условиями Политики конфиденциальности +
+ + ); + })()} +
); diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 0cc7b7c..e495215 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -385,7 +385,7 @@ const Header: React.FC = ({ onOpenAuthModal = () => console.log('Au
- + diff --git a/src/components/index/BrandSelectionSection.tsx b/src/components/index/BrandSelectionSection.tsx index 1ebf006..5ec5891 100644 --- a/src/components/index/BrandSelectionSection.tsx +++ b/src/components/index/BrandSelectionSection.tsx @@ -147,7 +147,7 @@ const BrandSelectionSection: React.FC = () => { diff --git a/src/components/profile/ProfileGarageMain.tsx b/src/components/profile/ProfileGarageMain.tsx index c3abe4d..dc015e4 100644 --- a/src/components/profile/ProfileGarageMain.tsx +++ b/src/components/profile/ProfileGarageMain.tsx @@ -247,63 +247,65 @@ const ProfileGarageMain = () => {
-
- - {/* Расширенная информация об автомобиле */} - {expandedVehicle === vehicle.id && ( -
+ {/* Расширенная информация об автомобиле — вложена внутрь карточки */} +
{vehicle.brand && (
- Бренд: - {vehicle.brand} +
Бренд
+
{vehicle.brand}
)} {vehicle.model && (
- Модель: - {vehicle.model} +
Модель
+
{vehicle.model}
)} {vehicle.modification && (
- Модификация: - {vehicle.modification} +
Модификация
+
{vehicle.modification}
)} {vehicle.year && (
- Год: - {vehicle.year} +
Год
+
{vehicle.year}
)} {vehicle.frame && (
- Номер кузова: - {vehicle.frame} +
Номер кузова
+
{vehicle.frame}
)} {vehicle.licensePlate && (
- Госномер: - {vehicle.licensePlate} +
Госномер
+
{vehicle.licensePlate}
)} {vehicle.mileage && (
- Пробег: - {vehicle.mileage.toLocaleString()} км +
Пробег
+
{vehicle.mileage.toLocaleString()} км
)}
- Добавлен: - +
Добавлен
+
{new Date(vehicle.createdAt).toLocaleDateString('ru-RU')} - +
- )} +
))} {!showAddCar && ( diff --git a/src/components/vin/VinQuick.tsx b/src/components/vin/VinQuick.tsx index a255017..26eac51 100644 --- a/src/components/vin/VinQuick.tsx +++ b/src/components/vin/VinQuick.tsx @@ -45,6 +45,8 @@ const VinQuick: React.FC = ({ quickGroup, catalogCode, vehicleId, } }; + const [shownCounts, setShownCounts] = useState<{ [unitid: string]: number }>({}); + return (
{/* */} @@ -71,16 +73,48 @@ const VinQuick: React.FC = ({ quickGroup, catalogCode, vehicleId,

{unit.name}

- - {unit.details && unit.details.length > 0 && unit.details.map((detail: any, index: number) => ( -
-
{detail.oem}
-
{detail.name}
- { e.preventDefault(); handleDetailClick(detail); }}>Показать цены -
- ))} - - { e.preventDefault(); handleUnitClick(unit); }}>Подробнее + {(() => { + const details = unit.details || []; + const total = details.length; + const shownCount = shownCounts[unit.unitid] ?? 3; + return ( + <> + {details.slice(0, shownCount).map((detail: any, index: number) => ( +
+
{detail.oem}
+
{detail.name}
+ { e.preventDefault(); handleDetailClick(detail); }}>Показать цены +
+ ))} + {total > 3 && shownCount < total && ( +
+ {shownCount + 3 < total && ( + + )} + +
+ )} + {shownCount >= total && ( + { e.preventDefault(); handleUnitClick(unit); }}>Подробнее + )} + + ); + })()}
)) diff --git a/src/styles/my.css b/src/styles/my.css index 9befbef..5ad1f36 100644 --- a/src/styles/my.css +++ b/src/styles/my.css @@ -30,7 +30,7 @@ } .bottom_head{ - z-index: 60; + z-index: 3000; } .top_head{ @@ -618,12 +618,48 @@ body { font-size: 28px; } +.form-block-4, +.flex-block-124, +.flex-block-6-copy +{ + overflow: visible !important; +} a.link-block.w-inline-block, a.link-block-2.w-inline-block { font-size: 12px; } +.core-product-search.carousel-scroll { + display: flex; + flex-wrap: nowrap; /* Не переносить строки */ + gap: 16px; /* Отступ между карточками, если нужно */ +} + +.subscribe{ + padding-top: 10px !important; + padding-bottom: 10px !important; + +} + +.text-block-14, .div-block-9{ + width: 350px !important; + max-width: 350px !important; + min-width: 350px !important; +} +@media screen and (max-width: 1920px) { + .text-block-14, .div-block-9{ + width: 350px !important; + } +} + + + +.flex-block-18{ + row-gap: 40px !important; +} + + .menu-button.w--open { z-index: 2000; @@ -631,10 +667,9 @@ a.link-block-2.w-inline-block { color: var(--white); justify-content: center; align-items: center; - height: 50px; - padding-top: 15px; - padding-bottom: 15px; - left: auto; + width: 50px; + height: 44px; + padding: 13px 12px; } .heading-7 { z-index: 999; @@ -671,15 +706,25 @@ a.link-block-2.w-inline-block { overflow: hidden; } +.flex-block-14-copy-copy{ + + margin-bottom: 20px !important; +} + +.showall-btn { + width: 100%; +} +.showall-btn:hover { + background: #ec1c24 !important; + color: #fff !important; +} + @media screen and (max-width: 991px) { .flex-block-108, .flex-block-14-copy-copy { flex-flow: column; justify-content: space-between; } - .flex-block-14-copy-copy{ - align-items: center; - } } @media screen and (max-width: 991px) { @@ -994,3 +1039,7 @@ a.link-block-2.w-inline-block { } } +.protekauto-logo { + position: fixed; + z-index: 3000; +} \ No newline at end of file diff --git a/src/styles/protekproject.webflow.css b/src/styles/protekproject.webflow.css index 7d87203..e0575b6 100644 --- a/src/styles/protekproject.webflow.css +++ b/src/styles/protekproject.webflow.css @@ -1008,10 +1008,9 @@ body { color: var(--white); justify-content: center; align-items: center; - height: 50px; - padding-top: 15px; - padding-bottom: 15px; - left: auto; + width: 50px; + height: 44px; + padding: 13px 12px; } .menu-button.w--open:hover {