@redneckz/wildless-cms-uni-blocks 0.14.915 → 0.14.917
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 +48 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -2
- package/bundle/components/Footer/LinkList.d.ts +0 -1
- package/bundle/model/AspectsProps.d.ts +9 -1
- package/bundle/retail/hooks/useReferalProgramm.d.ts +1 -0
- package/bundle/ui-kit/Sitemap/SitemapProps.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -2
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +5 -21
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/Footer/LinkList.d.ts +0 -1
- package/dist/components/Footer/LinkList.js +2 -2
- package/dist/components/Footer/LinkList.js.map +1 -1
- package/dist/model/AspectsProps.d.ts +9 -1
- package/dist/retail/hooks/useReferalProgramm.d.ts +1 -0
- package/dist/retail/hooks/useReferalProgramm.js +43 -0
- package/dist/retail/hooks/useReferalProgramm.js.map +1 -0
- package/dist/ui-kit/Sitemap/Sitemap.js +3 -3
- package/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/dist/ui-kit/Sitemap/SitemapProps.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -2
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +5 -21
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/Footer/LinkList.d.ts +0 -1
- package/lib/components/Footer/LinkList.js +2 -2
- package/lib/components/Footer/LinkList.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/model/AspectsProps.d.ts +9 -1
- package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
- package/lib/retail/hooks/useReferalProgramm.d.ts +1 -0
- package/lib/retail/hooks/useReferalProgramm.js +40 -0
- package/lib/retail/hooks/useReferalProgramm.js.map +1 -0
- package/lib/ui-kit/Sitemap/Sitemap.js +3 -3
- package/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/lib/ui-kit/Sitemap/SitemapProps.d.ts +1 -0
- package/mobile/bundle/bundle.umd.js +45 -25
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -2
- package/mobile/bundle/components/Footer/LinkList.d.ts +0 -1
- package/mobile/bundle/model/AspectsProps.d.ts +9 -1
- package/mobile/bundle/retail/hooks/useReferalProgramm.d.ts +1 -0
- package/mobile/bundle/ui-kit/Sitemap/SitemapProps.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -2
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +5 -21
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/Footer/LinkList.d.ts +0 -1
- package/mobile/dist/components/Footer/LinkList.js +2 -2
- package/mobile/dist/components/Footer/LinkList.js.map +1 -1
- package/mobile/dist/model/AspectsProps.d.ts +9 -1
- package/mobile/dist/retail/hooks/useReferalProgramm.d.ts +1 -0
- package/mobile/dist/retail/hooks/useReferalProgramm.js +43 -0
- package/mobile/dist/retail/hooks/useReferalProgramm.js.map +1 -0
- package/mobile/dist/ui-kit/Sitemap/SitemapProps.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -2
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +5 -21
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/Footer/LinkList.d.ts +0 -1
- package/mobile/lib/components/Footer/LinkList.js +2 -2
- package/mobile/lib/components/Footer/LinkList.js.map +1 -1
- package/mobile/lib/model/AspectsProps.d.ts +9 -1
- package/mobile/lib/retail/hooks/useReferalProgramm.d.ts +1 -0
- package/mobile/lib/retail/hooks/useReferalProgramm.js +40 -0
- package/mobile/lib/retail/hooks/useReferalProgramm.js.map +1 -0
- package/mobile/lib/ui-kit/Sitemap/SitemapProps.d.ts +1 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +6 -32
- package/mobile/src/components/Footer/LinkList.tsx +2 -7
- package/mobile/src/model/AspectsProps.ts +11 -1
- package/mobile/src/retail/hooks/useReferalProgramm.ts +45 -0
- package/mobile/src/ui-kit/Sitemap/SitemapProps.ts +1 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +6 -32
- package/src/components/Footer/LinkList.tsx +2 -7
- package/src/model/AspectsProps.ts +11 -1
- package/src/retail/hooks/useReferalProgramm.ts +45 -0
- package/src/ui-kit/Sitemap/Sitemap.tsx +29 -29
- package/src/ui-kit/Sitemap/SitemapProps.ts +1 -0
|
@@ -4,8 +4,8 @@ import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
|
4
4
|
import { useSetter } from '../../hooks/useSetter';
|
|
5
5
|
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
|
|
6
6
|
import { type MarketingInfo } from '../../retail/api/updateUserTask';
|
|
7
|
+
import { useReferalProgramm } from '../../retail/hooks/useReferalProgramm';
|
|
7
8
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
8
|
-
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
9
9
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
10
10
|
import { QUERY_STORAGE_KEY } from '../../utils/getSessionQuery';
|
|
11
11
|
import { EsiaStatuses, type ProductType } from './ApplicationLeadFormContent';
|
|
@@ -23,7 +23,6 @@ type InitApplicationLeadProps = {
|
|
|
23
23
|
|
|
24
24
|
export interface ApplicationLeadStore {
|
|
25
25
|
marketingInfo: MarketingInfo | null;
|
|
26
|
-
referalData: ReferalData | null;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
export const useInitApplicationLead = ({
|
|
@@ -36,6 +35,7 @@ export const useInitApplicationLead = ({
|
|
|
36
35
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
37
36
|
const sessionStore = useSessionStore<ApplicationLeadStore>();
|
|
38
37
|
const queryFromStorage = globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY);
|
|
38
|
+
useReferalProgramm();
|
|
39
39
|
|
|
40
40
|
const initialFormState = useMemo(
|
|
41
41
|
() => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
|
|
@@ -69,20 +69,7 @@ export const useInitApplicationLead = ({
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
leadFormStore.productType = productType;
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
queryFromStorage,
|
|
74
|
-
sessionStore,
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
if (referalCode) {
|
|
78
|
-
sessionStore.referalData = {
|
|
79
|
-
refererCode,
|
|
80
|
-
referalCode,
|
|
81
|
-
productId,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
sessionStore.marketingInfo = marketingInfo;
|
|
72
|
+
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
86
73
|
}, [queryFromStorage]);
|
|
87
74
|
|
|
88
75
|
useEffect(() => {
|
|
@@ -102,19 +89,13 @@ export const useInitApplicationLead = ({
|
|
|
102
89
|
return initialFormState;
|
|
103
90
|
};
|
|
104
91
|
|
|
105
|
-
const
|
|
106
|
-
queryFromStorage: string | null,
|
|
107
|
-
sessionStore: ApplicationLeadStore,
|
|
108
|
-
) => {
|
|
109
|
-
const referalData = sessionStore.referalData;
|
|
92
|
+
const getMarketingInfo = (queryFromStorage: string | null, sessionStore: ApplicationLeadStore) => {
|
|
110
93
|
const marketingInfoFromStorage = sessionStore.marketingInfo;
|
|
111
94
|
const queryStorage = new URLSearchParams(decodeURIComponent(queryFromStorage || ''));
|
|
112
95
|
|
|
113
96
|
const code = queryStorage.get('code');
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
117
|
-
const marketingInfo = code
|
|
97
|
+
|
|
98
|
+
return code
|
|
118
99
|
? marketingInfoFromStorage
|
|
119
100
|
: {
|
|
120
101
|
utm_campaign: queryStorage.get('utm_campaign'),
|
|
@@ -125,11 +106,4 @@ const getLeadQueryParams = (
|
|
|
125
106
|
bannerId: queryStorage.get('bannerId'),
|
|
126
107
|
userId: queryStorage.get('userId'),
|
|
127
108
|
};
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
referalCode,
|
|
131
|
-
refererCode,
|
|
132
|
-
productId,
|
|
133
|
-
marketingInfo,
|
|
134
|
-
};
|
|
135
109
|
};
|
|
@@ -8,17 +8,12 @@ import { style } from '../../utils/style';
|
|
|
8
8
|
|
|
9
9
|
interface LinkListProps extends ComponentType {
|
|
10
10
|
items?: LinkProps[];
|
|
11
|
-
isFlex?: boolean;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
export const LinkList = JSX<LinkListProps>(({ className
|
|
13
|
+
export const LinkList = JSX<LinkListProps>(({ className, items }) => {
|
|
15
14
|
const link = useLink();
|
|
16
15
|
|
|
17
|
-
return (
|
|
18
|
-
<ul className={style(isFlex ? 'flex flex-col gap-s' : 'block', 'w-full', className)}>
|
|
19
|
-
{items?.map(renderLinkListItem(link))}
|
|
20
|
-
</ul>
|
|
21
|
-
);
|
|
16
|
+
return <ul className={style('w-full', className)}>{items?.map(renderLinkListItem(link))}</ul>;
|
|
22
17
|
});
|
|
23
18
|
|
|
24
19
|
const renderLinkListItem =
|
|
@@ -35,6 +35,15 @@ export type ChatBotAspect = {
|
|
|
35
35
|
aspectName: 'openChatBot';
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @title Отправить событие партнёру
|
|
40
|
+
* @default {"aspectName": "partnersEvent", "params": {"partner": "", "typeAction": "targetaction"}}
|
|
41
|
+
*/
|
|
42
|
+
export type PartnersEventAspect = {
|
|
43
|
+
aspectName: 'partnersEvent';
|
|
44
|
+
params?: AspectData;
|
|
45
|
+
};
|
|
46
|
+
|
|
38
47
|
/**
|
|
39
48
|
* @title Не выбрано
|
|
40
49
|
*/
|
|
@@ -52,7 +61,8 @@ export type AspectsDef =
|
|
|
52
61
|
| ChatBotAspect
|
|
53
62
|
| YandexReachGoalAspect
|
|
54
63
|
| MindboxEventAspect
|
|
55
|
-
| SnowplowEventAspect
|
|
64
|
+
| SnowplowEventAspect
|
|
65
|
+
| PartnersEventAspect;
|
|
56
66
|
|
|
57
67
|
export type AspectsProps = {
|
|
58
68
|
/** @title Дополнительные атрибуты */
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useLeadFormStore } from '../../components/ApplicationLeadForm/useLeadFormStore';
|
|
3
|
+
import { handleAspects } from '../../hooks/useAspects/handleAspects';
|
|
4
|
+
import { useAspects } from '../../hooks/useAspects/useAspects';
|
|
5
|
+
import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
|
|
6
|
+
|
|
7
|
+
export const useReferalProgramm = () => {
|
|
8
|
+
const leadFormStore = useLeadFormStore();
|
|
9
|
+
const aspects = useAspects();
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
13
|
+
|
|
14
|
+
const referalCode = params.get('referalCode');
|
|
15
|
+
const refererCode = params.get('refererCode');
|
|
16
|
+
const productId = params.get('productId');
|
|
17
|
+
|
|
18
|
+
if (referalCode) {
|
|
19
|
+
leadFormStore.referalData = {
|
|
20
|
+
refererCode,
|
|
21
|
+
referalCode,
|
|
22
|
+
productId,
|
|
23
|
+
};
|
|
24
|
+
const eventJSON = JSON.stringify({
|
|
25
|
+
refererCode,
|
|
26
|
+
referalCode,
|
|
27
|
+
productId,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
handleAspects({
|
|
31
|
+
aspectsAttributes: [
|
|
32
|
+
{
|
|
33
|
+
aspectName: 'snowplowEvent',
|
|
34
|
+
params: {
|
|
35
|
+
eventName: 'ownfin_referal_link_attributes',
|
|
36
|
+
eventJSON,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
aspects,
|
|
41
|
+
ev: {} as PreventableEventWithTarget,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, []);
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ import { type ProductType } from './ApplicationLeadFormContent';
|
|
|
24
24
|
import { productTypeToConsentsMap } from './consents';
|
|
25
25
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
26
26
|
import { type ApplicationLeadStore } from './useInitApplicationLead';
|
|
27
|
+
import { useLeadFormStore } from './useLeadFormStore';
|
|
27
28
|
import { useSaveUserData, type UserData } from './useSaveUserData';
|
|
28
29
|
import { useSendLeadFormAspects } from './useSendLeadFormAspects';
|
|
29
30
|
|
|
@@ -44,6 +45,7 @@ export const useApplicationLeadApi = ({
|
|
|
44
45
|
const [ok, setOK] = useState<boolean | undefined>();
|
|
45
46
|
const saveUserData = useSaveUserData();
|
|
46
47
|
const sessionStore = useSessionStore<ApplicationLeadStore>();
|
|
48
|
+
const leadFormStore = useLeadFormStore();
|
|
47
49
|
|
|
48
50
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
49
51
|
const navigator = locationNavigator();
|
|
@@ -64,7 +66,7 @@ export const useApplicationLeadApi = ({
|
|
|
64
66
|
profile: { phone: formatPhone(transformedFormData.phone as string) },
|
|
65
67
|
});
|
|
66
68
|
|
|
67
|
-
const referalData =
|
|
69
|
+
const referalData = leadFormStore.referalData;
|
|
68
70
|
const marketingInfo = sessionStore.marketingInfo;
|
|
69
71
|
|
|
70
72
|
if (!profileId) {
|
|
@@ -4,8 +4,8 @@ import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
|
4
4
|
import { useSetter } from '../../hooks/useSetter';
|
|
5
5
|
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
|
|
6
6
|
import { type MarketingInfo } from '../../retail/api/updateUserTask';
|
|
7
|
+
import { useReferalProgramm } from '../../retail/hooks/useReferalProgramm';
|
|
7
8
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
8
|
-
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
9
9
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
10
10
|
import { QUERY_STORAGE_KEY } from '../../utils/getSessionQuery';
|
|
11
11
|
import { EsiaStatuses, type ProductType } from './ApplicationLeadFormContent';
|
|
@@ -23,7 +23,6 @@ type InitApplicationLeadProps = {
|
|
|
23
23
|
|
|
24
24
|
export interface ApplicationLeadStore {
|
|
25
25
|
marketingInfo: MarketingInfo | null;
|
|
26
|
-
referalData: ReferalData | null;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
export const useInitApplicationLead = ({
|
|
@@ -36,6 +35,7 @@ export const useInitApplicationLead = ({
|
|
|
36
35
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
37
36
|
const sessionStore = useSessionStore<ApplicationLeadStore>();
|
|
38
37
|
const queryFromStorage = globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY);
|
|
38
|
+
useReferalProgramm();
|
|
39
39
|
|
|
40
40
|
const initialFormState = useMemo(
|
|
41
41
|
() => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
|
|
@@ -69,20 +69,7 @@ export const useInitApplicationLead = ({
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
leadFormStore.productType = productType;
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
queryFromStorage,
|
|
74
|
-
sessionStore,
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
if (referalCode) {
|
|
78
|
-
sessionStore.referalData = {
|
|
79
|
-
refererCode,
|
|
80
|
-
referalCode,
|
|
81
|
-
productId,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
sessionStore.marketingInfo = marketingInfo;
|
|
72
|
+
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
86
73
|
}, [queryFromStorage]);
|
|
87
74
|
|
|
88
75
|
useEffect(() => {
|
|
@@ -102,19 +89,13 @@ export const useInitApplicationLead = ({
|
|
|
102
89
|
return initialFormState;
|
|
103
90
|
};
|
|
104
91
|
|
|
105
|
-
const
|
|
106
|
-
queryFromStorage: string | null,
|
|
107
|
-
sessionStore: ApplicationLeadStore,
|
|
108
|
-
) => {
|
|
109
|
-
const referalData = sessionStore.referalData;
|
|
92
|
+
const getMarketingInfo = (queryFromStorage: string | null, sessionStore: ApplicationLeadStore) => {
|
|
110
93
|
const marketingInfoFromStorage = sessionStore.marketingInfo;
|
|
111
94
|
const queryStorage = new URLSearchParams(decodeURIComponent(queryFromStorage || ''));
|
|
112
95
|
|
|
113
96
|
const code = queryStorage.get('code');
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
117
|
-
const marketingInfo = code
|
|
97
|
+
|
|
98
|
+
return code
|
|
118
99
|
? marketingInfoFromStorage
|
|
119
100
|
: {
|
|
120
101
|
utm_campaign: queryStorage.get('utm_campaign'),
|
|
@@ -125,11 +106,4 @@ const getLeadQueryParams = (
|
|
|
125
106
|
bannerId: queryStorage.get('bannerId'),
|
|
126
107
|
userId: queryStorage.get('userId'),
|
|
127
108
|
};
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
referalCode,
|
|
131
|
-
refererCode,
|
|
132
|
-
productId,
|
|
133
|
-
marketingInfo,
|
|
134
|
-
};
|
|
135
109
|
};
|
|
@@ -8,17 +8,12 @@ import { style } from '../../utils/style';
|
|
|
8
8
|
|
|
9
9
|
interface LinkListProps extends ComponentType {
|
|
10
10
|
items?: LinkProps[];
|
|
11
|
-
isFlex?: boolean;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
export const LinkList = JSX<LinkListProps>(({ className
|
|
13
|
+
export const LinkList = JSX<LinkListProps>(({ className, items }) => {
|
|
15
14
|
const link = useLink();
|
|
16
15
|
|
|
17
|
-
return (
|
|
18
|
-
<ul className={style(isFlex ? 'flex flex-col gap-s' : 'block', 'w-full', className)}>
|
|
19
|
-
{items?.map(renderLinkListItem(link))}
|
|
20
|
-
</ul>
|
|
21
|
-
);
|
|
16
|
+
return <ul className={style('w-full', className)}>{items?.map(renderLinkListItem(link))}</ul>;
|
|
22
17
|
});
|
|
23
18
|
|
|
24
19
|
const renderLinkListItem =
|
|
@@ -35,6 +35,15 @@ export type ChatBotAspect = {
|
|
|
35
35
|
aspectName: 'openChatBot';
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @title Отправить событие партнёру
|
|
40
|
+
* @default {"aspectName": "partnersEvent", "params": {"partner": "", "typeAction": "targetaction"}}
|
|
41
|
+
*/
|
|
42
|
+
export type PartnersEventAspect = {
|
|
43
|
+
aspectName: 'partnersEvent';
|
|
44
|
+
params?: AspectData;
|
|
45
|
+
};
|
|
46
|
+
|
|
38
47
|
/**
|
|
39
48
|
* @title Не выбрано
|
|
40
49
|
*/
|
|
@@ -52,7 +61,8 @@ export type AspectsDef =
|
|
|
52
61
|
| ChatBotAspect
|
|
53
62
|
| YandexReachGoalAspect
|
|
54
63
|
| MindboxEventAspect
|
|
55
|
-
| SnowplowEventAspect
|
|
64
|
+
| SnowplowEventAspect
|
|
65
|
+
| PartnersEventAspect;
|
|
56
66
|
|
|
57
67
|
export type AspectsProps = {
|
|
58
68
|
/** @title Дополнительные атрибуты */
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useLeadFormStore } from '../../components/ApplicationLeadForm/useLeadFormStore';
|
|
3
|
+
import { handleAspects } from '../../hooks/useAspects/handleAspects';
|
|
4
|
+
import { useAspects } from '../../hooks/useAspects/useAspects';
|
|
5
|
+
import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
|
|
6
|
+
|
|
7
|
+
export const useReferalProgramm = () => {
|
|
8
|
+
const leadFormStore = useLeadFormStore();
|
|
9
|
+
const aspects = useAspects();
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
13
|
+
|
|
14
|
+
const referalCode = params.get('referalCode');
|
|
15
|
+
const refererCode = params.get('refererCode');
|
|
16
|
+
const productId = params.get('productId');
|
|
17
|
+
|
|
18
|
+
if (referalCode) {
|
|
19
|
+
leadFormStore.referalData = {
|
|
20
|
+
refererCode,
|
|
21
|
+
referalCode,
|
|
22
|
+
productId,
|
|
23
|
+
};
|
|
24
|
+
const eventJSON = JSON.stringify({
|
|
25
|
+
refererCode,
|
|
26
|
+
referalCode,
|
|
27
|
+
productId,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
handleAspects({
|
|
31
|
+
aspectsAttributes: [
|
|
32
|
+
{
|
|
33
|
+
aspectName: 'snowplowEvent',
|
|
34
|
+
params: {
|
|
35
|
+
eventName: 'ownfin_referal_link_attributes',
|
|
36
|
+
eventJSON,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
aspects,
|
|
41
|
+
ev: {} as PreventableEventWithTarget,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, []);
|
|
45
|
+
};
|
|
@@ -11,37 +11,35 @@ import { type SitemapProps } from './SitemapProps';
|
|
|
11
11
|
const FOOTER_AREA_KEYS = ['all', 'footer'];
|
|
12
12
|
const IS_SINGLE_SEARCH_INDEX = Boolean(env.SINGLE_SEARCH_INDEX);
|
|
13
13
|
|
|
14
|
-
export const Sitemap = JSX<SitemapProps>(
|
|
15
|
-
|
|
14
|
+
export const Sitemap = JSX<SitemapProps>(
|
|
15
|
+
({ className, navigationItems, isSearchPanel = false }) => {
|
|
16
|
+
const link = useLink();
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
const filteredItems = navigationItems?.filter(isVisibleItem(FOOTER_AREA_KEYS))?.map(link) ?? [];
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const [firstItem] = filteredItems;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
});
|
|
22
|
+
return (
|
|
23
|
+
<div className="space-y-2">
|
|
24
|
+
{IS_SINGLE_SEARCH_INDEX && isSearchPanel ? (
|
|
25
|
+
<div>
|
|
26
|
+
<LinkList className="block columns-3 space-y-3 gap-x-6xl" items={firstItem?.items} />
|
|
27
|
+
</div>
|
|
28
|
+
) : (
|
|
29
|
+
<div
|
|
30
|
+
role="menu"
|
|
31
|
+
className={style(
|
|
32
|
+
'w-full flex items-start justify-between flex-col md:flex-row gap-m lg:order-2',
|
|
33
|
+
className,
|
|
34
|
+
)}
|
|
35
|
+
>
|
|
36
|
+
{filteredItems?.map(renderColumn)}
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
45
43
|
|
|
46
44
|
const renderColumn = (menuItem: TopMenuItemProps & { onClick: () => void }, index: number) => {
|
|
47
45
|
const { text, items = [], href, target = '_self', onClick, dataFooter } = menuItem;
|
|
@@ -60,7 +58,9 @@ const renderColumn = (menuItem: TopMenuItemProps & { onClick: () => void }, inde
|
|
|
60
58
|
>
|
|
61
59
|
{text}
|
|
62
60
|
</a>
|
|
63
|
-
{visibleSubItems ?
|
|
61
|
+
{visibleSubItems ? (
|
|
62
|
+
<LinkList className="flex flex-col gap-s" items={visibleSubItems} />
|
|
63
|
+
) : null}
|
|
64
64
|
</div>
|
|
65
65
|
);
|
|
66
66
|
};
|