From 653b15e09c77b9916d86710d296c31d40624521e Mon Sep 17 00:00:00 2001 From: "dev.daminik00" Date: Tue, 21 Oct 2025 21:20:35 +0200 Subject: [PATCH] add blur --- .../builder/templates/TemplateConfig.tsx | 43 +++++++++++++++++++ .../templates/ListTemplate/ListTemplate.tsx | 3 ++ .../templates/layouts/TemplateLayout.tsx | 8 ++++ src/components/ui/MainButton/MainButton.tsx | 4 +- .../BottomActionButton/BottomActionButton.tsx | 5 ++- src/lib/funnel/mappers.tsx | 16 ++++++- src/lib/funnel/screenRenderer.tsx | 4 ++ src/lib/funnel/templateHelpers.ts | 7 +++ 8 files changed, 84 insertions(+), 6 deletions(-) diff --git a/src/components/admin/builder/templates/TemplateConfig.tsx b/src/components/admin/builder/templates/TemplateConfig.tsx index 50b32b6..ce762ad 100644 --- a/src/components/admin/builder/templates/TemplateConfig.tsx +++ b/src/components/admin/builder/templates/TemplateConfig.tsx @@ -357,6 +357,7 @@ function ActionButtonControls({ const buttonText = value?.text || ""; const cornerRadius = value?.cornerRadius; const showPrivacyTermsConsent = value?.showPrivacyTermsConsent ?? false; + const showGradientBlur = value?.showGradientBlur ?? true; const handleToggle = (enabled: boolean) => { if (enabled) { @@ -435,6 +436,29 @@ function ActionButtonControls({ } }; + const handleGradientBlurToggle = (checked: boolean) => { + // Работает даже когда кнопка отключена (для LIST экранов) + const newValue = { + ...value, + // Если checked = true (дефолт), не сохраняем поле + // Если checked = false, сохраняем явно + showGradientBlur: checked ? undefined : false, + }; + + // Убираем undefined поля для чистоты + if ( + !newValue.text && + !newValue.cornerRadius && + newValue.show !== false && + !newValue.showPrivacyTermsConsent && + newValue.showGradientBlur !== false + ) { + onChange(undefined); + } else { + onChange(newValue); + } + }; + return (
)} + + {/* Gradient Blur - доступен даже когда кнопка отключена */} +
+ +
); } diff --git a/src/components/funnel/templates/ListTemplate/ListTemplate.tsx b/src/components/funnel/templates/ListTemplate/ListTemplate.tsx index 6b646e9..ad76b1b 100644 --- a/src/components/funnel/templates/ListTemplate/ListTemplate.tsx +++ b/src/components/funnel/templates/ListTemplate/ListTemplate.tsx @@ -20,6 +20,7 @@ export interface ListTemplateProps { skipCheckChanges?: boolean ) => void; actionButtonProps?: ActionButtonProps; + showGradientBlur?: boolean; canGoBack: boolean; onBack: () => void; screenProgress?: { current: number; total: number }; @@ -37,6 +38,7 @@ export function ListTemplate({ selectedOptionIds, onSelectionChange, actionButtonProps, + showGradientBlur, canGoBack, onBack, screenProgress, @@ -119,6 +121,7 @@ export function ListTemplate({ { preset: "left", actionButton: actionButtonOptions, + showGradientBlur, } ); diff --git a/src/components/funnel/templates/layouts/TemplateLayout.tsx b/src/components/funnel/templates/layouts/TemplateLayout.tsx index db8205f..ef56211 100644 --- a/src/components/funnel/templates/layouts/TemplateLayout.tsx +++ b/src/components/funnel/templates/layouts/TemplateLayout.tsx @@ -56,6 +56,7 @@ interface TemplateLayoutProps { disabled: boolean; onClick: () => void; }; + showGradientBlur?: boolean; // Дополнительные props для BottomActionButton childrenAboveButton?: React.ReactNode; @@ -96,6 +97,7 @@ export function TemplateLayout({ size: "lg", }, actionButtonOptions, + showGradientBlur, childrenAboveButton, childrenUnderButton, childrenAboveTitle, @@ -124,6 +126,12 @@ export function TemplateLayout({ screen, actionButtonOptions, }) + : showGradientBlur + ? // Если нет кнопки, но нужен blur (для LIST экранов) + { + actionButtonProps: undefined, + showGradientBlur: true, + } : undefined; // 🎯 Автоматически создаем PrivacyTermsConsent с фиксированными настройками diff --git a/src/components/ui/MainButton/MainButton.tsx b/src/components/ui/MainButton/MainButton.tsx index a82d121..78e0181 100644 --- a/src/components/ui/MainButton/MainButton.tsx +++ b/src/components/ui/MainButton/MainButton.tsx @@ -16,7 +16,7 @@ const buttonVariants = cva( "pl-[26px] pr-[18px] py-[18px]", "transition-[background-color,border-color,color]", "duration-200", - "disabled:opacity-30", + "disabled:opacity-20", "border-2", "[-webkit-tap-highlight-color:transparent]", "[transform:translateZ(0)]" @@ -78,7 +78,7 @@ function MainButton({