@@ -7,6 +7,7 @@ import {YandexFormProps} from '../../models';
77import { DefaultEventNames } from '../../models/common' ;
88import { block } from '../../utils' ;
99import { HEADER_HEIGHT } from '../constants' ;
10+ import { ProjectSettingsContext } from '../../context/projectSettingsContext' ;
1011
1112export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru' ;
1213export const YANDEX_FORM_SECTION = 'surveys' ;
@@ -36,11 +37,13 @@ const YandexForm = (props: YandexFormProps) => {
3637 const handleAnalytics = useAnalytics ( DefaultEventNames . YandexFormSubmit ) ;
3738 const isMobile = React . useContext ( MobileContext ) ;
3839 const locale = React . useContext ( LocaleContext ) ;
40+ const { defaultYandexFormTheme} = React . useContext ( ProjectSettingsContext ) ;
3941
4042 const updateFormIframe = React . useCallback (
4143 ( container : HTMLDivElement ) => {
4244 const queryParams = new URLSearchParams ( location . search ) ;
4345 const url = location . origin + location . pathname ;
46+ const formTheme = theme || defaultYandexFormTheme ;
4447
4548 queryParams . set ( 'url' , url ) ;
4649 queryParams . set ( 'iframe' , '1' ) ;
@@ -49,7 +52,9 @@ const YandexForm = (props: YandexFormProps) => {
4952 queryParams . set ( 'lang' , locale . lang ) ;
5053 }
5154
52- queryParams . set ( 'theme' , theme || 'cloud-www' ) ;
55+ if ( formTheme ) {
56+ queryParams . set ( 'theme' , formTheme ) ;
57+ }
5358
5459 if ( isMobile ) {
5560 queryParams . set ( 'media-type' , 'mobile' ) ;
0 commit comments