@@ -7,6 +7,7 @@ import {YandexFormProps} from '../../models';
7
7
import { DefaultEventNames } from '../../models/common' ;
8
8
import { block } from '../../utils' ;
9
9
import { HEADER_HEIGHT } from '../constants' ;
10
+ import { ProjectSettingsContext } from '../../context/projectSettingsContext' ;
10
11
11
12
export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru' ;
12
13
export const YANDEX_FORM_SECTION = 'surveys' ;
@@ -36,11 +37,13 @@ const YandexForm = (props: YandexFormProps) => {
36
37
const handleAnalytics = useAnalytics ( DefaultEventNames . YandexFormSubmit ) ;
37
38
const isMobile = React . useContext ( MobileContext ) ;
38
39
const locale = React . useContext ( LocaleContext ) ;
40
+ const { defaultYandexFormTheme} = React . useContext ( ProjectSettingsContext ) ;
39
41
40
42
const updateFormIframe = React . useCallback (
41
43
( container : HTMLDivElement ) => {
42
44
const queryParams = new URLSearchParams ( location . search ) ;
43
45
const url = location . origin + location . pathname ;
46
+ const formTheme = theme || defaultYandexFormTheme ;
44
47
45
48
queryParams . set ( 'url' , url ) ;
46
49
queryParams . set ( 'iframe' , '1' ) ;
@@ -49,7 +52,9 @@ const YandexForm = (props: YandexFormProps) => {
49
52
queryParams . set ( 'lang' , locale . lang ) ;
50
53
}
51
54
52
- queryParams . set ( 'theme' , theme || 'cloud-www' ) ;
55
+ if ( formTheme ) {
56
+ queryParams . set ( 'theme' , formTheme ) ;
57
+ }
53
58
54
59
if ( isMobile ) {
55
60
queryParams . set ( 'media-type' , 'mobile' ) ;
0 commit comments