@ashtuka/react-lib 1.0.38 → 1.0.39
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/README.md +3 -0
- package/dist/components/LoadAbleImg/LoadAbleImg.d.ts +9 -0
- package/dist/components/LoadAbleImg/index.d.ts +1 -0
- package/dist/constants/breakpoints.d.ts +5 -5
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.es.js +5 -0
- package/dist/hooks/useDevice.d.ts +17 -0
- package/dist/hooks/useOnScreen-CpqVO1-u.mjs +28 -0
- package/dist/hooks/useOnScreen.d.ts +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +4 -2
- package/dist/modules/FooterV2Module/AppsList/AppsList.d.ts +1 -0
- package/dist/modules/FooterV2Module/AppsList/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/FooterBottom/FooterBottom.d.ts +8 -0
- package/dist/modules/FooterV2Module/FooterBottom/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/FooterHeader/FooterHeader.d.ts +12 -0
- package/dist/modules/FooterV2Module/FooterHeader/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/FooterMenu/FooterMenu.d.ts +11 -0
- package/dist/modules/FooterV2Module/FooterMenu/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/FooterV2Module-Cd4z2v8y.mjs +387 -0
- package/dist/modules/FooterV2Module/FooterV2Module.css +1 -0
- package/dist/modules/FooterV2Module/FooterV2Module.d.ts +2 -0
- package/dist/modules/FooterV2Module/FooterV2Module.types.d.ts +52 -0
- package/dist/modules/FooterV2Module/PaymentSystems/PaymentSystems.d.ts +5 -0
- package/dist/modules/FooterV2Module/PaymentSystems/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/Phone/Phone.d.ts +7 -0
- package/dist/modules/FooterV2Module/Phone/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/SocialList/SocialList.d.ts +13 -0
- package/dist/modules/FooterV2Module/SocialList/index.d.ts +1 -0
- package/dist/modules/FooterV2Module/index.d.ts +2 -0
- package/dist/modules/FooterV2Module/index.es.js +4 -0
- package/dist/modules/FooterV2Module/utils/getAbsUrl.d.ts +3 -0
- package/dist/modules/FooterV2Module/utils/index.d.ts +2 -0
- package/dist/modules/FooterV2Module/utils/setFooterStyle.d.ts +3 -0
- package/dist/modules/PageLoaderModule/PageLoaderModule-D6yGXr6Z.mjs +100 -0
- package/dist/modules/PageLoaderModule/PageLoaderModule.d.ts +1 -2
- package/dist/modules/PageLoaderModule/index.es.js +4 -0
- package/dist/services/LayoutService.d.ts +9 -0
- package/dist/services/Service.d.ts +13 -0
- package/dist/services/utils/getHost.d.ts +1 -0
- package/dist/services/utils/index.d.ts +1 -0
- package/dist/types/Header.d.ts +34 -0
- package/dist/types/Locale-D0KYJGGt.mjs +4 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +12 -10
- package/dist/modules/PageLoaderModule/PageLoaderModule-C7IoevYf.mjs +0 -369
- package/dist/modules/PageLoaderModule/PageLoaderModule.es.js +0 -4
- /package/dist/{utils.es.js → utils/index.es.js} +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
# @ashtuka/react-lib
|
|
2
2
|
|
|
3
3
|
React-бібліотека компонентів (для навчання)
|
|
4
|
+
Поточні обмеження:
|
|
5
|
+
- модуль, призначений для експорту, повинен лежати в теці modules у своїй власній паці з назвою, що закінчується на Modules
|
|
6
|
+
- наразі не реалізована можливість використовувати один модуль у середині іншого (при build не буде теки shared, де буде вказано правильний порядок імпортів. Наразі в нас плоска структура entry point)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoadAbleImg';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
1
|
+
export declare const SM = 576;
|
|
2
|
+
export declare const MD = 768;
|
|
3
|
+
export declare const LG = 992;
|
|
4
|
+
export declare const XL = 1200;
|
|
5
|
+
export declare const XXL = 1400;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Хук визначає, чи поточна ширина вікна браузера знаходиться в заданому діапазоні.
|
|
3
|
+
*
|
|
4
|
+
* @param from - Мінімальна ширина в пікселях (включно).
|
|
5
|
+
* @param to - Максимальна ширина в пікселях (не включно).
|
|
6
|
+
* @returns true, якщо ширина вікна в межах [from, to), інакше false.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const isTablet = useDevice(768, 1024);
|
|
11
|
+
*
|
|
12
|
+
* if (isTablet) {
|
|
13
|
+
* console.log("Користувач переглядає сайт на планшеті");
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export default function useDevice(from: number, to: number): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useState as s, useEffect as o } from "react";
|
|
2
|
+
function d(e, r) {
|
|
3
|
+
const [t, i] = s(window.outerWidth);
|
|
4
|
+
return o(() => {
|
|
5
|
+
const n = () => i(document.body.getBoundingClientRect().width);
|
|
6
|
+
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
7
|
+
}, []), t >= e && t < r;
|
|
8
|
+
}
|
|
9
|
+
function w(e, r = "0px") {
|
|
10
|
+
const [t, i] = s(!1);
|
|
11
|
+
return o(() => {
|
|
12
|
+
const n = new IntersectionObserver(
|
|
13
|
+
([c]) => {
|
|
14
|
+
i(c.isIntersecting);
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
rootMargin: r
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
return e.current && n.observe(e.current), () => {
|
|
21
|
+
e.current && n.unobserve(e.current);
|
|
22
|
+
};
|
|
23
|
+
}, []), t;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
w as a,
|
|
27
|
+
d as u
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Хук визначає, чи елемент знаходиться у видимій області вікна браузера (viewport).
|
|
3
|
+
*
|
|
4
|
+
* @param ref - Ref-об’єкт елемента, за яким потрібно спостерігати.
|
|
5
|
+
* @param rootMargin - Відступи (margin) навколо viewport для розширення або зменшення зони спостереження (за замовчуванням "0px").
|
|
6
|
+
* @returns true, якщо елемент перетинає зону видимості, інакше false.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const ref = useRef<HTMLDivElement>(null);
|
|
11
|
+
* const isVisible = useOnScreen(ref, "-100px");
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <div ref={ref}>
|
|
15
|
+
* {isVisible ? "Елемент на екрані" : "Елемент поза екраном"}
|
|
16
|
+
* </div>
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import { RefObject } from 'react';
|
|
21
|
+
export default function useOnScreen(ref: RefObject<HTMLElement | null>, rootMargin?: string): boolean;
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { P as
|
|
1
|
+
import { P as r } from "./modules/PageLoaderModule/PageLoaderModule-D6yGXr6Z.mjs";
|
|
2
|
+
import { F as d } from "./modules/FooterV2Module/FooterV2Module-Cd4z2v8y.mjs";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
d as FooterV2Module,
|
|
5
|
+
r as PageLoaderModule
|
|
4
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AppsList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AppsList';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type FooterBottomProps = {
|
|
2
|
+
copyrightText: string;
|
|
3
|
+
isMob: boolean;
|
|
4
|
+
isPaymentSystem: boolean;
|
|
5
|
+
isAppStore: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const FooterBottom: ({ copyrightText, isMob, isPaymentSystem, isAppStore, }: FooterBottomProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FooterBottom } from './FooterBottom';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Locale } from '@/types';
|
|
2
|
+
import { FooterOptionsType } from '../FooterV2Module.types';
|
|
3
|
+
type FooterHeaderProps = {
|
|
4
|
+
locale: Locale;
|
|
5
|
+
label: string;
|
|
6
|
+
isMob: boolean;
|
|
7
|
+
isTab: boolean;
|
|
8
|
+
isDesk: boolean;
|
|
9
|
+
options?: FooterOptionsType;
|
|
10
|
+
};
|
|
11
|
+
export declare const FooterHeader: ({ locale, options, isMob, isTab, isDesk, label }: FooterHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FooterHeader } from './FooterHeader';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Locale } from '@/types';
|
|
2
|
+
import { FooterData } from '../FooterV2Module.types';
|
|
3
|
+
type FooterMenuProps = {
|
|
4
|
+
locale: Locale;
|
|
5
|
+
footerData: FooterData | null;
|
|
6
|
+
isAppList: boolean;
|
|
7
|
+
isMenu: boolean;
|
|
8
|
+
isOption: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const FooterMenu: ({ locale, isAppList, isMenu, footerData, isOption, }: FooterMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FooterMenu } from './FooterMenu';
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
var W = Object.defineProperty;
|
|
2
|
+
var R = (t, e, o) => e in t ? W(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var w = (t, e, o) => R(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
5
|
+
import { useState as N, useRef as I, useEffect as M, useMemo as P } from "react";
|
|
6
|
+
import B from "react-localization";
|
|
7
|
+
import q from "axios";
|
|
8
|
+
import { a as G, u as x } from "../../hooks/useOnScreen-CpqVO1-u.mjs";
|
|
9
|
+
import { L as S } from "../../types/Locale-D0KYJGGt.mjs";
|
|
10
|
+
const K = () => ["localhost", "test.polis.ua", "polisua-dev.svc.cluster.local"].some((e) => window.location.hostname.includes(e)) ? "https://test.polis.ua" : "https://polis.ua";
|
|
11
|
+
class X {
|
|
12
|
+
constructor(e, o) {
|
|
13
|
+
w(this, "BASE_PATH");
|
|
14
|
+
w(this, "HOST");
|
|
15
|
+
this.BASE_PATH = o, this.HOST = e;
|
|
16
|
+
}
|
|
17
|
+
async request(e, o) {
|
|
18
|
+
let c = `${this.HOST}${this.BASE_PATH}${e}`;
|
|
19
|
+
const {
|
|
20
|
+
method: l = "GET",
|
|
21
|
+
data: u,
|
|
22
|
+
params: n,
|
|
23
|
+
headers: a
|
|
24
|
+
} = o;
|
|
25
|
+
if (n) {
|
|
26
|
+
const s = new URL(c), i = new URLSearchParams({ ...n });
|
|
27
|
+
s.search = i.toString(), c = s.toString();
|
|
28
|
+
}
|
|
29
|
+
const h = {
|
|
30
|
+
url: c.toString(),
|
|
31
|
+
method: l,
|
|
32
|
+
data: u,
|
|
33
|
+
headers: a
|
|
34
|
+
};
|
|
35
|
+
try {
|
|
36
|
+
return (await q.request(h)).data;
|
|
37
|
+
} catch (s) {
|
|
38
|
+
throw console.error(`API Error on ${l} ${e}:`, s), new Error(
|
|
39
|
+
JSON.stringify({
|
|
40
|
+
message: "Request failed",
|
|
41
|
+
endpoint: e,
|
|
42
|
+
method: l,
|
|
43
|
+
originalError: s instanceof Error ? s.message : String(s)
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const Y = K(), j = "/api";
|
|
50
|
+
class V extends X {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(Y, j);
|
|
53
|
+
}
|
|
54
|
+
async fetchHeaderData() {
|
|
55
|
+
return this.request("/menu-v3/new/root", {});
|
|
56
|
+
}
|
|
57
|
+
async fetchFooterData() {
|
|
58
|
+
return this.request("/menu/footer/root", {});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const T = 768, L = 992, J = 1400, Q = "_container_z8lgs_1", Z = "_containerLoaded_z8lgs_30", ee = "_image_z8lgs_34", te = "_imageLoaded_z8lgs_42", g = {
|
|
62
|
+
container: Q,
|
|
63
|
+
containerLoaded: Z,
|
|
64
|
+
image: ee,
|
|
65
|
+
imageLoaded: te
|
|
66
|
+
};
|
|
67
|
+
function p(t) {
|
|
68
|
+
const { src: e, srcWebp: o = "", alt: c = "", onLoad: l = () => {
|
|
69
|
+
}, width: u = "100%", height: n = "100%" } = t, [a, h] = N(!1), s = I(null), i = I(null), _ = G(i);
|
|
70
|
+
M(() => {
|
|
71
|
+
!_ || a || s.current && (s.current.onload = () => {
|
|
72
|
+
h(!0), l();
|
|
73
|
+
});
|
|
74
|
+
}, [_, l, a]);
|
|
75
|
+
const d = o ? /* @__PURE__ */ m("picture", { children: [
|
|
76
|
+
/* @__PURE__ */ r(
|
|
77
|
+
"source",
|
|
78
|
+
{
|
|
79
|
+
style: { width: u, height: n },
|
|
80
|
+
className: a ? g.imageLoaded : g.image,
|
|
81
|
+
srcSet: o,
|
|
82
|
+
type: "image/webp"
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ r(
|
|
86
|
+
"img",
|
|
87
|
+
{
|
|
88
|
+
style: { width: u, height: n },
|
|
89
|
+
ref: s,
|
|
90
|
+
className: a ? g.imageLoaded : g.image,
|
|
91
|
+
src: e,
|
|
92
|
+
alt: c,
|
|
93
|
+
referrerPolicy: "no-referrer"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }) : /* @__PURE__ */ r(
|
|
97
|
+
"img",
|
|
98
|
+
{
|
|
99
|
+
style: { width: u, height: n },
|
|
100
|
+
ref: s,
|
|
101
|
+
className: a ? g.imageLoaded : g.image,
|
|
102
|
+
src: e,
|
|
103
|
+
alt: c,
|
|
104
|
+
referrerPolicy: "no-referrer"
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
return /* @__PURE__ */ r(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
style: { width: u, height: n },
|
|
111
|
+
ref: i,
|
|
112
|
+
className: a ? g.containerLoaded : g.container,
|
|
113
|
+
children: (_ || a) && d
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
const re = "_phoneContainer_1n93l_1", oe = "_phone_1n93l_1", ce = "_phoneTitle_1n93l_19", k = {
|
|
118
|
+
phoneContainer: re,
|
|
119
|
+
phone: oe,
|
|
120
|
+
phoneTitle: ce
|
|
121
|
+
}, b = ({ phone: t, locale: e }) => {
|
|
122
|
+
const o = t ? `tel:${t}` : "tel:0800208824", c = new B({
|
|
123
|
+
uk: {
|
|
124
|
+
title: "(безкоштовно по Україні)"
|
|
125
|
+
},
|
|
126
|
+
ru: {
|
|
127
|
+
title: "(бесплатно по Украине)"
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return c.setLanguage(e), /* @__PURE__ */ m("div", { className: k.phoneContainer, children: [
|
|
131
|
+
/* @__PURE__ */ r("a", { className: k.phone, href: o, children: t || "0 800 20 88 24" }),
|
|
132
|
+
!t && /* @__PURE__ */ r("p", { className: k.phoneTitle, children: c.title })
|
|
133
|
+
] });
|
|
134
|
+
}, ae = "_socialList_1agn2_1", le = {
|
|
135
|
+
socialList: ae
|
|
136
|
+
}, E = "https://polis.ua/static/img/react-modules/footerModule/social/facebook.svg", U = "https://polis.ua/static/img/react-modules/footerModule/social/youtube.svg", D = "https://polis.ua/static/img/react-modules/footerModule/social/telegram.svg", F = "https://polis.ua/static/img/react-modules/footerModule/social/tiktok.svg", z = "https://polis.ua/static/img/react-modules/footerModule/social/instagram.svg", se = [
|
|
137
|
+
{
|
|
138
|
+
id: 1,
|
|
139
|
+
iconSrc: E,
|
|
140
|
+
href: "https://www.facebook.com/polis.ua.insurance/"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 2,
|
|
144
|
+
iconSrc: U,
|
|
145
|
+
href: "https://www.youtube.com/channel/UC_OX5i3CYGk9_QdI3nUruaw"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 3,
|
|
149
|
+
iconSrc: D,
|
|
150
|
+
href: "https://t.me/polis4u"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 4,
|
|
154
|
+
iconSrc: F,
|
|
155
|
+
href: "https://www.tiktok.com/@polis.ua"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 5,
|
|
159
|
+
iconSrc: z,
|
|
160
|
+
href: "https://www.instagram.com/polis.ua/"
|
|
161
|
+
}
|
|
162
|
+
], A = ({ socialList: t, isAgent: e }) => {
|
|
163
|
+
if (e && !t) return null;
|
|
164
|
+
const o = [
|
|
165
|
+
(t == null ? void 0 : t.facebook) && {
|
|
166
|
+
id: 1,
|
|
167
|
+
iconSrc: E,
|
|
168
|
+
href: t.facebook
|
|
169
|
+
},
|
|
170
|
+
(t == null ? void 0 : t.youtube) && {
|
|
171
|
+
id: 2,
|
|
172
|
+
iconSrc: U,
|
|
173
|
+
href: t.youtube
|
|
174
|
+
},
|
|
175
|
+
(t == null ? void 0 : t.telegram) && {
|
|
176
|
+
id: 3,
|
|
177
|
+
iconSrc: D,
|
|
178
|
+
href: t.telegram
|
|
179
|
+
},
|
|
180
|
+
(t == null ? void 0 : t.tiktok) && {
|
|
181
|
+
id: 4,
|
|
182
|
+
iconSrc: F,
|
|
183
|
+
href: t.tiktok
|
|
184
|
+
},
|
|
185
|
+
(t == null ? void 0 : t.instagram) && {
|
|
186
|
+
id: 5,
|
|
187
|
+
iconSrc: z,
|
|
188
|
+
href: t.instagram
|
|
189
|
+
}
|
|
190
|
+
].filter(Boolean), c = e ? o : se;
|
|
191
|
+
return /* @__PURE__ */ r("ul", { className: le.socialList, children: c.map((l) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r("a", { href: l.href, rel: "nofollow noreferrer", target: "_blank", children: /* @__PURE__ */ r(p, { src: l.iconSrc, width: "24px", height: "24px" }) }) }, l.id)) });
|
|
192
|
+
}, ne = "_appsList_s60ek_1", ue = {
|
|
193
|
+
appsList: ne
|
|
194
|
+
}, ie = [
|
|
195
|
+
{
|
|
196
|
+
id: 1,
|
|
197
|
+
imgSrc: "https://polis.ua/static/img/react-modules/footerModule/store/apple.svg",
|
|
198
|
+
href: "https://apps.apple.com/ua/app/polis-ua/id1529609326?l=ru#?platform=iphone"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 2,
|
|
202
|
+
imgSrc: "https://polis.ua/static/img/react-modules/footerModule/store/huawei.svg",
|
|
203
|
+
href: "https://appgallery.huawei.com/#/app/C103880333"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: 3,
|
|
207
|
+
imgSrc: "https://polis.ua/static/img/react-modules/footerModule/store/google.svg",
|
|
208
|
+
href: "https://play.google.com/store/apps/details?id=com.polisua"
|
|
209
|
+
}
|
|
210
|
+
], C = () => /* @__PURE__ */ r("ul", { className: ue.appsList, children: ie.map((t) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
211
|
+
"a",
|
|
212
|
+
{
|
|
213
|
+
href: t.href,
|
|
214
|
+
rel: "nofollow noreferrer",
|
|
215
|
+
target: "_blank",
|
|
216
|
+
children: /* @__PURE__ */ r(
|
|
217
|
+
p,
|
|
218
|
+
{
|
|
219
|
+
src: t.imgSrc,
|
|
220
|
+
width: "94px",
|
|
221
|
+
height: "32px"
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
) }, t.id)) }), O = (t, e) => {
|
|
226
|
+
let o = e;
|
|
227
|
+
const c = window.location.href;
|
|
228
|
+
return (c.includes("test") || c.includes("localhost")) && (o = o.replace("polis", "test.polis")), t === S.UK && (o = o.replace("ua/", "ua/uk")), o;
|
|
229
|
+
}, me = (t) => {
|
|
230
|
+
const e = document.querySelector(":root");
|
|
231
|
+
e && (t["--footer-bg"] && e.style.setProperty("--footer-bg", t["--footer-bg"]), t["--footer-color"] && e.style.setProperty("--footer-color", t["--footer-color"]), t["--footer-color-hover"] && e.style.setProperty("--footer-color-hover", t["--footer-color-hover"]));
|
|
232
|
+
}, he = "_header_matcm_1", de = "_logoBlock_matcm_14", ge = "_logoContainer_matcm_20", fe = "_logoText_matcm_25", _e = "_contactBlock_matcm_47", y = {
|
|
233
|
+
header: he,
|
|
234
|
+
logoBlock: de,
|
|
235
|
+
logoContainer: ge,
|
|
236
|
+
logoText: fe,
|
|
237
|
+
contactBlock: _e
|
|
238
|
+
}, ye = "https://polis.ua/static/img/react-modules/footerModule/logo/logoDesk.svg", pe = "https://polis.ua/static/img/react-modules/footerModule/logo/logoTab.svg", Se = "https://polis.ua/static/img/react-modules/footerModule/logo/logoMob.svg", we = ({ locale: t, options: e, isMob: o, isTab: c, isDesk: l, label: u }) => {
|
|
239
|
+
const { logo: n, logoWidth: a, logoHeight: h } = P(() => {
|
|
240
|
+
if (e != null && e.logoUrl) {
|
|
241
|
+
const s = e != null && e.logoWidthMob ? `${e.logoWidthMob}px` : "121px", i = e != null && e.logoWidthDesk ? `${e.logoWidthDesk}px` : "160px";
|
|
242
|
+
return {
|
|
243
|
+
logo: e.logoUrl,
|
|
244
|
+
logoWidth: (o || c) && s || l && i || "",
|
|
245
|
+
logoHeight: "auto"
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
logo: o && Se || c && pe || l && ye || "",
|
|
250
|
+
logoWidth: o && "87px" || c && "121px" || l && "160px" || "",
|
|
251
|
+
logoHeight: o && "33px" || c && "47px" || l && "65px" || ""
|
|
252
|
+
};
|
|
253
|
+
}, [o, c, l, e]);
|
|
254
|
+
return /* @__PURE__ */ m("header", { className: y.header, children: [
|
|
255
|
+
/* @__PURE__ */ m("div", { className: y.logoBlock, children: [
|
|
256
|
+
/* @__PURE__ */ m("div", { className: y.logoContainer, children: [
|
|
257
|
+
/* @__PURE__ */ r("a", { href: (e == null ? void 0 : e.logoHref) || O(t, "https://polis.ua/"), children: /* @__PURE__ */ r(p, { src: n, width: a, height: h }) }),
|
|
258
|
+
o && /* @__PURE__ */ r(b, { phone: e == null ? void 0 : e.phone, locale: t })
|
|
259
|
+
] }),
|
|
260
|
+
/* @__PURE__ */ r("p", { className: y.logoText, children: u }),
|
|
261
|
+
o && /* @__PURE__ */ r(A, { socialList: e == null ? void 0 : e.socialNetwork, isAgent: !!e })
|
|
262
|
+
] }),
|
|
263
|
+
/* @__PURE__ */ m("div", { className: y.contactBlock, children: [
|
|
264
|
+
(c || l) && /* @__PURE__ */ r(b, { phone: e == null ? void 0 : e.phone, locale: t }),
|
|
265
|
+
(c || l) && /* @__PURE__ */ r(A, { socialList: e == null ? void 0 : e.socialNetwork, isAgent: !!e }),
|
|
266
|
+
c && !(e != null && e.hideAppStore) && /* @__PURE__ */ r(C, {})
|
|
267
|
+
] })
|
|
268
|
+
] });
|
|
269
|
+
}, xe = "_paymentSystem_naesr_1", ke = "_tas_naesr_24", $ = {
|
|
270
|
+
paymentSystem: xe,
|
|
271
|
+
tas: ke
|
|
272
|
+
}, ve = "https://polis.ua/static/img/react-modules/footerModule/visa.svg", Ne = "https://polis.ua/static/img/react-modules/footerModule/mastercard.svg", Me = ({ isMob: t }) => /* @__PURE__ */ m("div", { className: $.paymentSystem, children: [
|
|
273
|
+
/* @__PURE__ */ r(p, { src: Ne, width: t ? "32.5px" : "39px", height: t ? "20px" : "24px" }),
|
|
274
|
+
/* @__PURE__ */ r(p, { src: ve, width: t ? "66.6px" : "80px", height: t ? "20px" : "24px" }),
|
|
275
|
+
/* @__PURE__ */ r("a", { className: $.tas, href: "https://tas.ua/", rel: "nofollow noreferrer", target: "_blank", children: "TAS" })
|
|
276
|
+
] }), Ce = "_footer_gsvy8_1", Ie = "_copyrightContainer_gsvy8_22", Te = "_copyright_gsvy8_22", v = {
|
|
277
|
+
footer: Ce,
|
|
278
|
+
copyrightContainer: Ie,
|
|
279
|
+
copyright: Te
|
|
280
|
+
}, Le = ({
|
|
281
|
+
copyrightText: t,
|
|
282
|
+
isMob: e,
|
|
283
|
+
isPaymentSystem: o,
|
|
284
|
+
isAppStore: c
|
|
285
|
+
}) => /* @__PURE__ */ m("footer", { className: v.footer, children: [
|
|
286
|
+
/* @__PURE__ */ m("div", { className: v.copyrightContainer, children: [
|
|
287
|
+
/* @__PURE__ */ r("p", { className: v.copyright, children: t }),
|
|
288
|
+
o && /* @__PURE__ */ r(Me, { isMob: e })
|
|
289
|
+
] }),
|
|
290
|
+
c && /* @__PURE__ */ r(C, {})
|
|
291
|
+
] }), be = "_menuContainer_17z7x_1", Ae = "_menu_17z7x_1", $e = "_menuItemList_17z7x_52", He = "_menuItemListDouble_17z7x_69", Pe = "_menuTitle_17z7x_85", Be = "_menuItemContainer_17z7x_103", Ee = "_menuItem_17z7x_52", f = {
|
|
292
|
+
menuContainer: be,
|
|
293
|
+
menu: Ae,
|
|
294
|
+
menuItemList: $e,
|
|
295
|
+
menuItemListDouble: He,
|
|
296
|
+
menuTitle: Pe,
|
|
297
|
+
menuItemContainer: Be,
|
|
298
|
+
menuItem: Ee
|
|
299
|
+
}, Ue = ({
|
|
300
|
+
locale: t,
|
|
301
|
+
isAppList: e,
|
|
302
|
+
isMenu: o,
|
|
303
|
+
footerData: c,
|
|
304
|
+
isOption: l
|
|
305
|
+
}) => {
|
|
306
|
+
const u = P(() => c ? t === S.UK ? c.menuUk : c.menuRu : null, [c, t]), n = (a) => {
|
|
307
|
+
const h = a.items.length > 10, s = h ? Math.ceil(a.items.length / 2) : a.items.length, i = (_) => /* @__PURE__ */ r("ul", { children: _.map((d) => /* @__PURE__ */ r("li", { className: f.menuItem, children: /* @__PURE__ */ r("a", { href: O(t, d.link), children: d.name }) }, d.name)) });
|
|
308
|
+
return /* @__PURE__ */ m(
|
|
309
|
+
"li",
|
|
310
|
+
{
|
|
311
|
+
className: h || l ? f.menuItemListDouble : f.menuItemList,
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ r("p", { className: f.menuTitle, children: a.title }),
|
|
314
|
+
/* @__PURE__ */ m("div", { className: h ? f.menuItemContainer : void 0, children: [
|
|
315
|
+
i(a.items.slice(0, s)),
|
|
316
|
+
h && i(a.items.slice(s))
|
|
317
|
+
] })
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
a.title
|
|
321
|
+
);
|
|
322
|
+
};
|
|
323
|
+
return /* @__PURE__ */ m("menu", { className: f.menuContainer, children: [
|
|
324
|
+
o && u && /* @__PURE__ */ r("ul", { className: f.menu, children: u.map(n) }),
|
|
325
|
+
e && /* @__PURE__ */ r(C, {})
|
|
326
|
+
] });
|
|
327
|
+
}, De = "_footerModuleContainer_1dtbf_7", Fe = "_footerModule_1dtbf_7", H = {
|
|
328
|
+
footerModuleContainer: De,
|
|
329
|
+
footerModule: Fe
|
|
330
|
+
}, Xe = ({ lang: t, options: e }) => {
|
|
331
|
+
const [o, c] = N(!1), [l, u] = N(null), n = (e == null ? void 0 : e.ukOnly) && S.UK || (e == null ? void 0 : e.ruOnly) && S.RU || t, a = x(0, T), h = x(T, L), s = x(L, J), i = new B({
|
|
332
|
+
uk: {
|
|
333
|
+
logoText: e != null && e.description ? e.description.uk : "Polis.ua - фінансовий онлайн-супермаркет. Загальнодержавний сервіс порівняння та оформлення кращих страхових та фінансових продуктів України. Свідомі фінансові рішення в декілька кліків.",
|
|
334
|
+
copyright: e != null && e.copyright ? e.copyright.uk : `© ТОВ «ПОЛІС.ЮА», ${(/* @__PURE__ */ new Date()).getFullYear()}. Всі права захищені.`
|
|
335
|
+
},
|
|
336
|
+
ru: {
|
|
337
|
+
logoText: e != null && e.description ? e.description.ru : "Polis.ua - финансовый онлайн-супермаркет. Общегосударственный сервис сравнения и оформления лучших страховых и финансовых продуктов Украины. Осознанные финансовые решения в несколько кликов.",
|
|
338
|
+
copyright: e != null && e.copyright ? e.copyright.ru : `© ООО «ПОЛИС.ЮА», ${(/* @__PURE__ */ new Date()).getFullYear()}. Все права защищены.`
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
return i.setLanguage(n), M(() => {
|
|
342
|
+
(async () => {
|
|
343
|
+
try {
|
|
344
|
+
const d = await new V().fetchFooterData();
|
|
345
|
+
u(d);
|
|
346
|
+
} catch (d) {
|
|
347
|
+
console.log(`An error occurred when trying fetch footer data => ${d}`), c(!0);
|
|
348
|
+
}
|
|
349
|
+
})();
|
|
350
|
+
}, []), M(() => {
|
|
351
|
+
e != null && e.stylesConfig && me(e == null ? void 0 : e.stylesConfig);
|
|
352
|
+
}, [e]), /* @__PURE__ */ r("section", { className: H.footerModuleContainer, children: /* @__PURE__ */ m("footer", { className: H.footerModule, children: [
|
|
353
|
+
/* @__PURE__ */ r(
|
|
354
|
+
we,
|
|
355
|
+
{
|
|
356
|
+
locale: n,
|
|
357
|
+
options: e,
|
|
358
|
+
isMob: a,
|
|
359
|
+
isTab: h,
|
|
360
|
+
isDesk: s,
|
|
361
|
+
label: i.logoText
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
/* @__PURE__ */ r(
|
|
365
|
+
Ue,
|
|
366
|
+
{
|
|
367
|
+
locale: n,
|
|
368
|
+
footerData: l,
|
|
369
|
+
isMenu: !o,
|
|
370
|
+
isAppList: a && !(e != null && e.hideAppStore),
|
|
371
|
+
isOption: !!e
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
/* @__PURE__ */ r(
|
|
375
|
+
Le,
|
|
376
|
+
{
|
|
377
|
+
isMob: a,
|
|
378
|
+
copyrightText: i.copyright,
|
|
379
|
+
isPaymentSystem: !e,
|
|
380
|
+
isAppStore: s && !(e != null && e.hideAppStore)
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
] }) });
|
|
384
|
+
};
|
|
385
|
+
export {
|
|
386
|
+
Xe as F
|
|
387
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_z8lgs_1{background:linear-gradient(101.42deg,#dfefff -.04%,#dfefff45 94.2%);box-sizing:border-box;overflow:hidden;width:100%;height:100%;position:relative}._container_z8lgs_1:before{content:"";display:block;position:absolute;left:-150px;top:0;height:100%;width:150px;background:linear-gradient(to right,transparent 0%,rgba(38,179,255,.0901960784) 50%,transparent 100%);animation:_load_z8lgs_1 1s cubic-bezier(.4,0,.2,1) infinite}@keyframes _load_z8lgs_1{0%{left:-150px}to{left:100%}}._containerLoaded_z8lgs_30:before{animation:none}._image_z8lgs_34{opacity:0;width:100%;height:100%;object-fit:cover;transition:opacity .3s ease-in-out}._imageLoaded_z8lgs_42{opacity:1}._phoneContainer_1n93l_1{display:flex;flex-direction:column;align-items:flex-end;margin-bottom:16px}._phone_1n93l_1{font:600 18px/120% latobold;color:var(--footer-color)!important}@media (min-width: 768px){._phone_1n93l_1{font-size:22px;line-height:29px}}._phoneTitle_1n93l_19{font-size:10px;line-height:15px;color:#2d2b2b}@media (min-width: 768px){._phoneTitle_1n93l_19{font-size:12px}}._socialList_1agn2_1{display:flex;align-items:center;width:224px;align-self:flex-end;margin-top:16px}@media (min-width: 768px){._socialList_1agn2_1{justify-content:flex-end;margin-top:0}}._socialList_1agn2_1 li{margin-right:25px}._socialList_1agn2_1 li:last-child{margin-right:0}._appsList_s60ek_1{display:flex;justify-content:space-between;width:298px;margin-top:16px}@media (min-width: 992px){._appsList_s60ek_1{margin-top:0}}._header_matcm_1{padding:16px 0;display:flex;align-items:flex-start;justify-content:space-between}@media (min-width: 992px){._header_matcm_1{padding:40px 0}}@media (min-width: 992px){._logoBlock_matcm_14{display:flex;align-items:center}}._logoContainer_matcm_20{display:flex;justify-content:space-between}._logoText_matcm_25{width:100%;font-size:14px;line-height:120%;color:var(--footer-color);margin-top:8px}@media (min-width: 768px){._logoText_matcm_25{width:320px;font-size:12px;line-height:15px}}@media (min-width: 992px){._logoText_matcm_25{margin-top:0;margin-left:40px;width:335px}}._contactBlock_matcm_47{display:flex;flex-direction:column}._paymentSystem_naesr_1{width:160px;display:flex;align-items:center;justify-content:space-between;margin-top:8px}@media (min-width: 576px){._paymentSystem_naesr_1{margin-top:0}}@media (min-width: 768px){._paymentSystem_naesr_1{width:190px}}@media (min-width: 992px){._paymentSystem_naesr_1{margin-top:16px}}._tas_naesr_24{font:700 26px/24px latobold;color:#e4e9ef;height:26px}@media (min-width: 768px){._tas_naesr_24{font-size:32px}}._footer_gsvy8_1{padding:8px 0;display:flex;justify-content:space-between}@media (min-width: 576px){._footer_gsvy8_1{padding:16px 0}}@media (min-width: 768px){._footer_gsvy8_1{padding:16px 0 8px}}@media (min-width: 992px){._footer_gsvy8_1{padding:40px 0 16px}}._copyrightContainer_gsvy8_22{width:100%;display:flex;flex-direction:column;align-items:center}@media (min-width: 576px){._copyrightContainer_gsvy8_22{flex-direction:row;justify-content:space-between}}@media (min-width: 992px){._copyrightContainer_gsvy8_22{width:auto;display:block}}._copyright_gsvy8_22{font-size:12px;line-height:115%;color:var(--footer-color)}@media (min-width: 992px){._copyright_gsvy8_22{font-size:14px;line-height:158.6%}}._menuContainer_17z7x_1{position:relative;padding:16px 0}@media (min-width: 992px){._menuContainer_17z7x_1{padding:40px 0}}._menuContainer_17z7x_1:before{position:absolute;top:0;left:-16px;width:calc(100% + 32px);border-top:1px solid #E9E9E9;content:""}@media (min-width: 992px){._menuContainer_17z7x_1:before{left:5%;width:90%}}._menuContainer_17z7x_1:after{position:absolute;bottom:0;left:-16px;width:calc(100% + 32px);border-bottom:1px solid #E9E9E9;content:""}@media (min-width: 992px){._menuContainer_17z7x_1:after{left:5%;width:90%}}._menu_17z7x_1{display:flex;flex-wrap:wrap;justify-content:space-between}@media (min-width: 768px){._menu_17z7x_1{flex-wrap:nowrap}}._menuItemList_17z7x_52{width:calc(50% - 24px);margin-bottom:16px;margin-right:24px}@media (min-width: 768px){._menuItemList_17z7x_52{width:auto;margin-bottom:0;margin-right:0}}._menuItemList_17z7x_52:last-child{margin-bottom:0}._menuItemListDouble_17z7x_69{width:100%;margin-bottom:16px}@media (min-width: 768px){._menuItemListDouble_17z7x_69{width:42%;margin-bottom:0}}@media (min-width: 992px){._menuItemListDouble_17z7x_69{width:38%}}._menuTitle_17z7x_85{font:700 18px/22px latobold;text-transform:uppercase;color:var(--footer-color);margin-bottom:16px}@media (min-width: 768px){._menuTitle_17z7x_85{font:400 12px/140% latoregular;letter-spacing:.02em}}@media (min-width: 992px){._menuTitle_17z7x_85{font-size:14px}}._menuItemContainer_17z7x_103{width:100%;display:flex}@media (min-width: 768px){._menuItemContainer_17z7x_103{justify-content:space-between}}._menuItemContainer_17z7x_103 ul{width:calc(50% - 24px);margin-right:24px}@media (min-width: 768px){._menuItemContainer_17z7x_103 ul{width:auto;margin-right:0}}._menuItem_17z7x_52{font-size:14px;line-height:130%;color:var(--footer-color);margin-bottom:8px;transition:color .2s ease-in-out}@media (min-width: 768px){._menuItem_17z7x_52{font-size:12px;line-height:115%;margin-bottom:12px}}@media (min-width: 992px){._menuItem_17z7x_52{margin-bottom:4px;font-size:14px;line-height:158.6%}}._menuItem_17z7x_52:hover{color:var(--footer-color-hover)}._menuItem_17z7x_52:last-child{margin-bottom:0}:root{--footer-bg: #fff;--footer-color: #374656;--footer-color-hover: #51BE8F}._footerModuleContainer_1dtbf_7{background:var(--footer-bg)}._footerModule_1dtbf_7{font-family:latoregular;width:calc(100% - 32px);max-width:1200px;margin:0 auto;cursor:default}@media (min-width: 1200px){._footerModule_1dtbf_7{padding:0;width:100%}}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Locale } from '@/types';
|
|
2
|
+
export type FooterMenuItem = {
|
|
3
|
+
name: string;
|
|
4
|
+
link: string;
|
|
5
|
+
};
|
|
6
|
+
export interface Menu {
|
|
7
|
+
title: string;
|
|
8
|
+
items: FooterMenuItem[];
|
|
9
|
+
}
|
|
10
|
+
export interface FooterData {
|
|
11
|
+
menuUk: Menu[];
|
|
12
|
+
menuRu: Menu[];
|
|
13
|
+
}
|
|
14
|
+
export interface FooterStyleConfig {
|
|
15
|
+
'--footer-bg'?: string;
|
|
16
|
+
'--footer-color'?: string;
|
|
17
|
+
'--footer-color-hover'?: string;
|
|
18
|
+
}
|
|
19
|
+
export type FooterOptionsType = {
|
|
20
|
+
logoUrl: string;
|
|
21
|
+
logoHref: string;
|
|
22
|
+
description: {
|
|
23
|
+
uk: string;
|
|
24
|
+
ru: string;
|
|
25
|
+
};
|
|
26
|
+
phone: string;
|
|
27
|
+
logoWidthMob?: number;
|
|
28
|
+
logoWidthDesk?: number;
|
|
29
|
+
socialNetwork?: {
|
|
30
|
+
facebook?: string;
|
|
31
|
+
youtube?: string;
|
|
32
|
+
telegram?: string;
|
|
33
|
+
tiktok?: string;
|
|
34
|
+
instagram?: string;
|
|
35
|
+
};
|
|
36
|
+
copyright?: {
|
|
37
|
+
uk: string;
|
|
38
|
+
ru: string;
|
|
39
|
+
};
|
|
40
|
+
hideAppStore?: boolean;
|
|
41
|
+
ruOnly?: boolean;
|
|
42
|
+
ukOnly?: boolean;
|
|
43
|
+
stylesConfig?: {
|
|
44
|
+
'--footer-bg'?: string;
|
|
45
|
+
'--footer-color'?: string;
|
|
46
|
+
'--footer-color-hover'?: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type FooterV2ModuleProps = {
|
|
50
|
+
lang: Locale;
|
|
51
|
+
options?: FooterOptionsType;
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PaymentSystems';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Phone';
|