@redneckz/wildless-cms-uni-blocks 0.14.140 → 0.14.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +79 -45
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/bundle/components/ApplicationForm/ApplicationFormCorruption.d.ts +12 -0
- package/bundle/components/ApplicationForm/ApplicationFormIndividuals.d.ts +3 -6
- package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/bundle/components/ApplicationForm/renderUserData.d.ts +8 -2
- package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +2 -4
- package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/dist/components/ApplicationForm/ApplicationFormCorruption.d.ts +12 -0
- package/dist/components/ApplicationForm/ApplicationFormCorruption.js +53 -0
- package/dist/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -0
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js +2 -4
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.d.ts +3 -6
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.js +3 -5
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/dist/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/dist/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/dist/components/ApplicationForm/renderUserData.d.ts +8 -2
- package/dist/components/ApplicationForm/renderUserData.js +7 -2
- package/dist/components/ApplicationForm/renderUserData.js.map +1 -1
- package/dist/ui-kit/BlockWrapper.js +3 -1
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +3 -5
- package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/lib/components/ApplicationForm/ApplicationFormCorruption.d.ts +12 -0
- package/lib/components/ApplicationForm/ApplicationFormCorruption.js +51 -0
- package/lib/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -0
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js +3 -5
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.d.ts +3 -6
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.js +3 -5
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/lib/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/lib/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/lib/components/ApplicationForm/renderUserData.d.ts +8 -2
- package/lib/components/ApplicationForm/renderUserData.js +6 -1
- package/lib/components/ApplicationForm/renderUserData.js.map +1 -1
- package/lib/ui-kit/BlockWrapper.js +3 -1
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +79 -45
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormCorruption.d.ts +12 -0
- package/mobile/bundle/components/ApplicationForm/ApplicationFormIndividuals.d.ts +3 -6
- package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/mobile/bundle/components/ApplicationForm/renderUserData.d.ts +8 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +2 -4
- package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormCorruption.d.ts +12 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormCorruption.js +53 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +2 -4
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.d.ts +3 -6
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js +3 -5
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderUserData.d.ts +8 -2
- package/mobile/dist/components/ApplicationForm/renderUserData.js +7 -2
- package/mobile/dist/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js +3 -1
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +3 -5
- package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +8 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCorruption.d.ts +12 -0
- package/mobile/lib/components/ApplicationForm/ApplicationFormCorruption.js +51 -0
- package/mobile/lib/components/ApplicationForm/ApplicationFormCorruption.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +3 -5
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.d.ts +3 -6
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js +3 -5
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +1 -0
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +2 -0
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderUserData.d.ts +8 -2
- package/mobile/lib/components/ApplicationForm/renderUserData.js +6 -1
- package/mobile/lib/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js +3 -1
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +3 -5
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +11 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormCorruption.tsx +103 -0
- package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +3 -5
- package/mobile/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +5 -11
- package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +2 -0
- package/mobile/src/components/ApplicationForm/renderUserData.tsx +18 -6
- package/mobile/src/ui-kit/BlockWrapper.tsx +3 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +14 -0
- package/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +3 -5
- package/src/components/ApplicationForm/ApplicationFormContent.ts +11 -1
- package/src/components/ApplicationForm/ApplicationFormCorruption.tsx +103 -0
- package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +3 -5
- package/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +5 -11
- package/src/components/ApplicationForm/EmbeddableForms.tsx +2 -0
- package/src/components/ApplicationForm/renderUserData.tsx +18 -6
- package/src/ui-kit/BlockWrapper.tsx +3 -1
|
@@ -103,6 +103,15 @@ export type AntiFraudFormParamsDef = TitleProps &
|
|
|
103
103
|
formType: 'ApplicationFormAntiFraud';
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @title Факты коррупции
|
|
108
|
+
*/
|
|
109
|
+
export type CorruptionFormParamsDef = TitleProps &
|
|
110
|
+
CommonApplicationFormProps & {
|
|
111
|
+
/** @default ApplicationFormCorruption */
|
|
112
|
+
formType: 'ApplicationFormCorruption';
|
|
113
|
+
};
|
|
114
|
+
|
|
106
115
|
/**
|
|
107
116
|
* @title Настройки формы
|
|
108
117
|
*/
|
|
@@ -115,7 +124,8 @@ export type ApplicationFormBlockDef =
|
|
|
115
124
|
| GrantSupportFormParamsDef
|
|
116
125
|
| IndividualsFormParamsDef
|
|
117
126
|
| FeedbackFormParamsDef
|
|
118
|
-
| AntiFraudFormParamsDef
|
|
127
|
+
| AntiFraudFormParamsDef
|
|
128
|
+
| CorruptionFormParamsDef;
|
|
119
129
|
|
|
120
130
|
/**
|
|
121
131
|
* @title Форма заявки
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function,max-lines */
|
|
2
|
+
|
|
3
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
4
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
5
|
+
import { useForm } from '../../hooks/useForm';
|
|
6
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
7
|
+
import { objectValidator } from '../../validation/objectValidator';
|
|
8
|
+
import { isValidationSuccess } from '../../validation/validator';
|
|
9
|
+
import { withValidator } from '../../validation/withValidator';
|
|
10
|
+
import { useGetRegions } from '../SafeDepositRental/useGetRegions';
|
|
11
|
+
import { ApplicationFieldsetLayout } from './ApplicationFieldsetLayout';
|
|
12
|
+
import { type ApplicationFormsProps } from './ApplicationFormsProps';
|
|
13
|
+
import { formStyle, oneColumnFormStyle } from './formStyle';
|
|
14
|
+
import { InputControl } from './InputControl';
|
|
15
|
+
import { PhoneInputControl } from './PhoneInputControl';
|
|
16
|
+
import { renderAgreementWithSubmit } from './renderAgreementWithSubmit';
|
|
17
|
+
import { initialUserFormState, renderUserData, type UserDataState } from './renderUserData';
|
|
18
|
+
import { SelectControl } from './SelectControl';
|
|
19
|
+
import { checkboxValidator, defaultValidator, nameValidator, phoneValidator } from './validators';
|
|
20
|
+
|
|
21
|
+
export type CorruptionFormState = UserDataState & {
|
|
22
|
+
typeForm: Option;
|
|
23
|
+
region?: Option;
|
|
24
|
+
phone: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
comment?: string;
|
|
27
|
+
consentDataProcessing: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const initialFormState: CorruptionFormState = {
|
|
31
|
+
...initialUserFormState,
|
|
32
|
+
typeForm: { key: 'CORRUPTION', text: 'Факты коррупции' },
|
|
33
|
+
phone: '',
|
|
34
|
+
email: '',
|
|
35
|
+
comment: '',
|
|
36
|
+
consentDataProcessing: false,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const feedbackValidator = objectValidator({
|
|
40
|
+
typeForm: defaultValidator,
|
|
41
|
+
surname: defaultValidator,
|
|
42
|
+
name: nameValidator,
|
|
43
|
+
region: defaultValidator,
|
|
44
|
+
phone: phoneValidator,
|
|
45
|
+
email: defaultValidator,
|
|
46
|
+
comment: defaultValidator,
|
|
47
|
+
consentDataProcessing: checkboxValidator,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const ApplicationFormCorruption = JSX<ApplicationFormsProps>(
|
|
51
|
+
({ button, link, onSubmit }) => {
|
|
52
|
+
const handleSubmit = useCallback(
|
|
53
|
+
(formState: CorruptionFormState) => {
|
|
54
|
+
const { typeForm, phone, region, ...usedFields } = formState;
|
|
55
|
+
|
|
56
|
+
const submitData = {
|
|
57
|
+
...usedFields,
|
|
58
|
+
typeForm: typeForm.key,
|
|
59
|
+
regionBranch: region?.text,
|
|
60
|
+
phone: phone.replace(/[^+\d]/g, ''),
|
|
61
|
+
};
|
|
62
|
+
isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
|
|
63
|
+
},
|
|
64
|
+
[onSubmit],
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const [, { field, ...formProps }] = useForm(initialFormState, handleSubmit);
|
|
68
|
+
const branch = useGetRegions();
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<form className={formStyle} onSubmit={formProps.onSubmit}>
|
|
72
|
+
<ApplicationFieldsetLayout
|
|
73
|
+
firstChildren={
|
|
74
|
+
<div className={oneColumnFormStyle}>
|
|
75
|
+
{renderUserData<CorruptionFormState>(field, false)}
|
|
76
|
+
<SelectControl
|
|
77
|
+
label="Филиал обслуживания*"
|
|
78
|
+
placeholder="Выберите филиал"
|
|
79
|
+
isSearch={true}
|
|
80
|
+
options={branch.map(({ code = '', name = '' }) => ({ key: code, text: name }))}
|
|
81
|
+
{...withValidator(field('region'), defaultValidator)}
|
|
82
|
+
/>
|
|
83
|
+
<PhoneInputControl
|
|
84
|
+
label="Телефон*"
|
|
85
|
+
{...withValidator(field('phone'), phoneValidator)}
|
|
86
|
+
/>
|
|
87
|
+
<InputControl
|
|
88
|
+
label="Электронная почта*"
|
|
89
|
+
{...withValidator(field('email'), defaultValidator)}
|
|
90
|
+
/>
|
|
91
|
+
<InputControl
|
|
92
|
+
{...withValidator(field('comment'), defaultValidator)}
|
|
93
|
+
placeholder="Ваше сообщение*"
|
|
94
|
+
isTextarea={true}
|
|
95
|
+
/>
|
|
96
|
+
{renderAgreementWithSubmit(field('consentDataProcessing'), link, button)}
|
|
97
|
+
</div>
|
|
98
|
+
}
|
|
99
|
+
/>
|
|
100
|
+
</form>
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
);
|
|
@@ -15,7 +15,7 @@ import { handleSubmitIndividual, handleSubmitLegal, handleSubmitQuestion } from
|
|
|
15
15
|
import { InputControl } from './InputControl';
|
|
16
16
|
import { PhoneInputControl } from './PhoneInputControl';
|
|
17
17
|
import { renderAgreementWithSubmit } from './renderAgreementWithSubmit';
|
|
18
|
-
import { renderUserData, type UserDataState } from './renderUserData';
|
|
18
|
+
import { initialUserFormState, renderUserData, type UserDataState } from './renderUserData';
|
|
19
19
|
import { SelectControl } from './SelectControl';
|
|
20
20
|
import { defaultValidator, innValidator, phoneValidator } from './validators';
|
|
21
21
|
|
|
@@ -37,11 +37,9 @@ export type FeedbackFormState = UserDataState & {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const initialFormState: FeedbackFormState = {
|
|
40
|
+
...initialUserFormState,
|
|
40
41
|
typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
|
|
41
42
|
serviceDirection: { key: 'Физическое лицо' },
|
|
42
|
-
surname: '',
|
|
43
|
-
name: '',
|
|
44
|
-
middleName: '',
|
|
45
43
|
birthday: undefined,
|
|
46
44
|
feedbackMethod: { key: 'Телефонный звонок' },
|
|
47
45
|
phone: '',
|
|
@@ -115,7 +113,7 @@ export const ApplicationFormFeedback = JSX<ApplicationFormsProps>(({ button, lin
|
|
|
115
113
|
{...withValidator(field('addressBranch'), defaultValidator)}
|
|
116
114
|
/>
|
|
117
115
|
) : null}
|
|
118
|
-
{renderUserData<FeedbackFormState>(field)}
|
|
116
|
+
{renderUserData<FeedbackFormState>(field, true)}
|
|
119
117
|
{isLegalEntity ? (
|
|
120
118
|
<div>
|
|
121
119
|
<InputControl label="ИНН*" {...withValidator(field('inn'), innValidator)} />
|
|
@@ -11,32 +11,26 @@ import { formStyle } from './formStyle';
|
|
|
11
11
|
import { InputControl } from './InputControl';
|
|
12
12
|
import { PhoneInputControl } from './PhoneInputControl';
|
|
13
13
|
import { renderAgreementWithSubmit } from './renderAgreementWithSubmit';
|
|
14
|
+
import { initialUserFormState, type UserDataState } from './renderUserData';
|
|
14
15
|
import { defaultValidator, nameValidator, phoneValidator } from './validators';
|
|
15
16
|
|
|
16
|
-
export
|
|
17
|
-
surname: string;
|
|
18
|
-
name: string;
|
|
19
|
-
middleName: string;
|
|
17
|
+
export type IndividualsFormState = UserDataState & {
|
|
20
18
|
phone: string;
|
|
21
19
|
email: string;
|
|
22
|
-
birthday: Date | undefined;
|
|
23
20
|
consentDataProcessing: boolean;
|
|
24
|
-
}
|
|
21
|
+
};
|
|
25
22
|
|
|
26
23
|
const initialFormState: IndividualsFormState = {
|
|
27
|
-
|
|
28
|
-
name: '',
|
|
29
|
-
middleName: '',
|
|
24
|
+
...initialUserFormState,
|
|
30
25
|
phone: '',
|
|
31
26
|
email: '',
|
|
32
27
|
birthday: undefined,
|
|
33
|
-
consentDataProcessing:
|
|
28
|
+
consentDataProcessing: false,
|
|
34
29
|
};
|
|
35
30
|
|
|
36
31
|
const individualsValidator = objectValidator({
|
|
37
32
|
surname: nameValidator,
|
|
38
33
|
name: nameValidator,
|
|
39
|
-
middleName: nameValidator,
|
|
40
34
|
phone: phoneValidator,
|
|
41
35
|
email: defaultValidator,
|
|
42
36
|
birthday: defaultValidator,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApplicationFormAcquiring } from './ApplicationFormAcquiring';
|
|
2
2
|
import { ApplicationFormAntiFraud } from './ApplicationFormAntiFraud';
|
|
3
3
|
import { ApplicationFormBusinessCard } from './ApplicationFormBusinessCard';
|
|
4
|
+
import { ApplicationFormCorruption } from './ApplicationFormCorruption';
|
|
4
5
|
import { ApplicationFormCredit } from './ApplicationFormCredit';
|
|
5
6
|
import { ApplicationFormDeposit } from './ApplicationFormDeposit';
|
|
6
7
|
import { ApplicationFormFeedback } from './ApplicationFormFeedback';
|
|
@@ -18,4 +19,5 @@ export const EmbeddableForms = {
|
|
|
18
19
|
ApplicationFormIndividuals,
|
|
19
20
|
ApplicationFormFeedback,
|
|
20
21
|
ApplicationFormAntiFraud,
|
|
22
|
+
ApplicationFormCorruption,
|
|
21
23
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FormFieldRegisterer } from '../../hooks/useForm';
|
|
2
2
|
import { withValidator } from '../../validation/withValidator';
|
|
3
3
|
import { type AntiFraudFormState } from './ApplicationFormAntiFraud';
|
|
4
|
+
import { type CorruptionFormState } from './ApplicationFormCorruption';
|
|
4
5
|
import { type FeedbackFormState } from './ApplicationFormFeedback';
|
|
5
6
|
import { DatePickerControl } from './DatePickerControl';
|
|
6
7
|
import { InputControl } from './InputControl';
|
|
@@ -10,19 +11,30 @@ export interface UserDataState {
|
|
|
10
11
|
surname: string;
|
|
11
12
|
name: string;
|
|
12
13
|
middleName?: string;
|
|
13
|
-
birthday
|
|
14
|
+
birthday?: Date | undefined;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export const
|
|
17
|
+
export const initialUserFormState = {
|
|
18
|
+
surname: '',
|
|
19
|
+
name: '',
|
|
20
|
+
middleName: '',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const renderUserData = <
|
|
24
|
+
T extends AntiFraudFormState | FeedbackFormState | CorruptionFormState,
|
|
25
|
+
>(
|
|
17
26
|
field: FormFieldRegisterer<T>,
|
|
27
|
+
isBirthday = true,
|
|
18
28
|
) => (
|
|
19
29
|
<div>
|
|
20
30
|
<InputControl label="Фамилия*" {...withValidator(field('surname'), nameValidator)} />
|
|
21
31
|
<InputControl label="Имя*" {...withValidator(field('name'), nameValidator)} />
|
|
22
32
|
<InputControl label="Отчество (Обязательно, при наличии)" {...field('middleName')} />
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
{isBirthday ? (
|
|
34
|
+
<DatePickerControl
|
|
35
|
+
label="Дата рождения*"
|
|
36
|
+
{...withValidator(field('birthday'), defaultValidator)}
|
|
37
|
+
/>
|
|
38
|
+
) : null}
|
|
27
39
|
</div>
|
|
28
40
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { defaultEventBus } from '../EventBus/defaultEventBus';
|
|
4
|
+
import { useRouter } from '../hooks/useRouter';
|
|
4
5
|
import { type BlockVersion } from '../model/BlockVersion';
|
|
5
6
|
import { type UniBlockProps } from '../model/JSXBlock';
|
|
6
7
|
import { style } from '../utils/style';
|
|
@@ -33,6 +34,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
33
34
|
style: inlineStyles,
|
|
34
35
|
}) => {
|
|
35
36
|
const Tag: any = tag;
|
|
37
|
+
const router = useRouter();
|
|
36
38
|
|
|
37
39
|
const [isHidden, setHidden] = useState(false);
|
|
38
40
|
|
|
@@ -45,7 +47,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
}),
|
|
48
|
-
[block],
|
|
50
|
+
[block, router],
|
|
49
51
|
);
|
|
50
52
|
|
|
51
53
|
const isGroup = version && isTheme;
|