@streamlayer/react-ui 1.12.1 → 1.13.1
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/lib/app/app/Advertisement/index.js +40 -38
- package/lib/app/app/Features/Gamification/Tabs.js +32 -30
- package/lib/app/app/story/index.d.ts +1 -0
- package/lib/app/app/story/index.js +28 -26
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/index.d.ts +2 -0
- package/lib/ui/advertisement/index.js +32 -26
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +73 -61
- package/lib/ui/gamification/question/notification/index.js +32 -24
- package/lib/ui/gamification/vote/vote-option/index.js +56 -54
- package/lib/ui/theme/constants.d.ts +3 -0
- package/lib/ui/theme/constants.js +20 -17
- package/lib/ui/theme/masters-theme.js +16 -10
- package/lib/ui/theme/theme.js +5 -3
- package/package.json +14 -14
|
@@ -1,47 +1,53 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { PromotionType as r } from "@streamlayer/sdk-web-types";
|
|
3
|
-
import { Banner as
|
|
4
|
-
import { Notification as
|
|
5
|
-
import { Overlay as
|
|
6
|
-
import { Sidebar as
|
|
7
|
-
import { OverlayContainer as
|
|
8
|
-
const
|
|
3
|
+
import { Banner as p } from "./banner/index.js";
|
|
4
|
+
import { Notification as q } from "./notification/index.js";
|
|
5
|
+
import { Overlay as N } from "./overlay/index.js";
|
|
6
|
+
import { Sidebar as E } from "./sidebar/index.js";
|
|
7
|
+
import { OverlayContainer as G } from "./overlay/styles.js";
|
|
8
|
+
const O = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === r.INGAME_IAB21_LBAR, a = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11 || (i == null ? void 0 : i.type) === r.INGAME_IAB21, x = ({
|
|
9
9
|
advertisement: i,
|
|
10
|
-
close:
|
|
10
|
+
close: l,
|
|
11
11
|
skipTypeCheck: u,
|
|
12
|
-
skipAutoClose:
|
|
13
|
-
layoutMode:
|
|
12
|
+
skipAutoClose: I,
|
|
13
|
+
layoutMode: d = "side-by-side",
|
|
14
14
|
sidebar: n,
|
|
15
|
-
isNotification:
|
|
15
|
+
isNotification: _,
|
|
16
16
|
banner: f,
|
|
17
|
-
markAsViewed:
|
|
18
|
-
open:
|
|
17
|
+
markAsViewed: t,
|
|
18
|
+
open: M,
|
|
19
19
|
externalAd: y,
|
|
20
|
-
controlVideo: c
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
controlVideo: c,
|
|
21
|
+
advertisementPaused: A,
|
|
22
|
+
togglePause: B
|
|
23
|
+
}) => i.promotion ? _ && i.notification ? /* @__PURE__ */ o(q, { open: M, notification: i.notification, promotionId: i.question.id }) : !n && !f && (u || a(i.promotion)) ? /* @__PURE__ */ o(G, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(
|
|
24
|
+
N,
|
|
23
25
|
{
|
|
24
|
-
markAsViewed:
|
|
26
|
+
markAsViewed: t,
|
|
25
27
|
promotionId: i.question.id,
|
|
26
28
|
promotion: i.promotion,
|
|
27
|
-
onClose:
|
|
28
|
-
skipAutoClose:
|
|
29
|
+
onClose: l,
|
|
30
|
+
skipAutoClose: I,
|
|
29
31
|
externalAd: y,
|
|
30
|
-
controlVideo: c
|
|
32
|
+
controlVideo: c,
|
|
33
|
+
advertisementPaused: A,
|
|
34
|
+
togglePause: B
|
|
31
35
|
}
|
|
32
|
-
) }) : n && (u ||
|
|
33
|
-
|
|
36
|
+
) }) : n && (u || O(i.promotion)) ? /* @__PURE__ */ o(E, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ o(
|
|
37
|
+
N,
|
|
34
38
|
{
|
|
35
|
-
markAsViewed:
|
|
39
|
+
markAsViewed: t,
|
|
36
40
|
promotionId: i.question.id,
|
|
37
41
|
promotion: i.promotion,
|
|
38
42
|
externalAd: y,
|
|
39
|
-
onClose:
|
|
43
|
+
onClose: l,
|
|
40
44
|
controlVideo: c,
|
|
41
|
-
skipAutoClose:
|
|
45
|
+
skipAutoClose: I,
|
|
46
|
+
advertisementPaused: A,
|
|
47
|
+
togglePause: B
|
|
42
48
|
}
|
|
43
49
|
) }) : f ? /* @__PURE__ */ o(
|
|
44
|
-
|
|
50
|
+
p,
|
|
45
51
|
{
|
|
46
52
|
promotionId: i.question.id,
|
|
47
53
|
hiding: !1,
|
|
@@ -50,5 +56,5 @@ const p = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i ==
|
|
|
50
56
|
}
|
|
51
57
|
) : null : null;
|
|
52
58
|
export {
|
|
53
|
-
|
|
59
|
+
x as AdvertisementUI
|
|
54
60
|
};
|
|
@@ -11,5 +11,7 @@ export type OverlayProps = {
|
|
|
11
11
|
inSidebar?: boolean;
|
|
12
12
|
externalAd?: Advertisement['externalAd'];
|
|
13
13
|
controlVideo: ControlVideoCb;
|
|
14
|
+
advertisementPaused: boolean;
|
|
15
|
+
togglePause: (flag: boolean) => void;
|
|
14
16
|
};
|
|
15
17
|
export declare const Overlay: React.FC<OverlayProps>;
|
|
@@ -1,101 +1,113 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import {
|
|
4
|
-
import { eventBus as
|
|
5
|
-
import { PromotionType as q, PromotionLogoMode as
|
|
6
|
-
import { CloseButton as
|
|
7
|
-
import { VideoPlayer as
|
|
8
|
-
import { ExternalAdOverlay as
|
|
9
|
-
import { PromoOverlay as
|
|
10
|
-
import { OverlayContainer as
|
|
11
|
-
const
|
|
12
|
-
var
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { cx as $ } from "@linaria/core";
|
|
3
|
+
import { useEffect as c } from "react";
|
|
4
|
+
import { eventBus as Z } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { PromotionType as q, PromotionLogoMode as i, AutoPlayVideo as oo, PromotionButtonType as eo } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { CloseButton as ro } from "../../close-btn/index.js";
|
|
7
|
+
import { VideoPlayer as to } from "../../video-player/index.js";
|
|
8
|
+
import { ExternalAdOverlay as no } from "./externalAd/index.js";
|
|
9
|
+
import { PromoOverlay as ao, Header as lo, HeaderContent as io, headerContentShift as so, SponsorLogo as z, Sponsor as mo, SponsorName as po, SponsorText as co, ADLogo as yo, SponsoredText as uo, Media as fo, shiftMedia as bo, Content as J, PromoImg as ho, Title as Ao, hideOnMobile as To, Description as vo, ActionBtnWrap as No, ActionButton as xo } from "./styles.js";
|
|
10
|
+
import { OverlayContainer as Uo } from "./styles.js";
|
|
11
|
+
const Io = (y) => {
|
|
12
|
+
var f, b, h, A, T, v, N, x, P, B, C, E, g, O, M, L, S, I, D, R, U, _, k, F, V, j, G, H, w, W;
|
|
13
|
+
const {
|
|
14
|
+
promotion: o,
|
|
15
|
+
advertisementPaused: K,
|
|
16
|
+
togglePause: r,
|
|
17
|
+
controlVideo: n,
|
|
18
|
+
skipAutoClose: Q,
|
|
19
|
+
promotionId: l,
|
|
20
|
+
onClose: X,
|
|
21
|
+
markAsViewed: s,
|
|
22
|
+
externalAd: u
|
|
23
|
+
} = y, d = o.type === q.INGAME_IAB11_LBAR || o.type === q.INGAME_IAB11, m = ((f = o.sponsor) == null ? void 0 : f.logo) && o.logoMode === i.CENTER, Y = !!((h = (b = o.banner) == null ? void 0 : b.video) != null && h.url), p = o.autoPlayVideo === oo.ENABLED;
|
|
24
|
+
if (c(() => {
|
|
25
|
+
r == null || r(Y || p);
|
|
26
|
+
}, []), c(() => {
|
|
27
|
+
l && o.type && s && s();
|
|
28
|
+
}, [l, o.type, s]), c(() => () => {
|
|
29
|
+
n == null || n({ muted: !1 });
|
|
30
|
+
}, [n]), u)
|
|
31
|
+
return /* @__PURE__ */ e(no, { ...y, externalAd: u });
|
|
32
|
+
let a = (A = o.banner) == null ? void 0 : A.url;
|
|
33
|
+
return a && a.indexOf("http") !== 0 && (a = `https://${a}`), /* @__PURE__ */ t(ao, { className: "PromoOverlay", children: [
|
|
34
|
+
/* @__PURE__ */ t(lo, { children: [
|
|
35
|
+
/* @__PURE__ */ t(io, { className: $(!m && so), children: [
|
|
36
|
+
((T = o.sponsor) == null ? void 0 : T.logo) && o.logoMode === i.LEFT && /* @__PURE__ */ e(z, { src: (v = o.sponsor) == null ? void 0 : v.logo, alt: "promo" }),
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
mo,
|
|
27
39
|
{
|
|
28
40
|
style: {
|
|
29
|
-
paddingLeft: (
|
|
41
|
+
paddingLeft: (N = o.sponsor) != null && N.logo && o.logoMode === i.LEFT ? "0px" : "8px"
|
|
30
42
|
},
|
|
31
43
|
children: [
|
|
32
|
-
((
|
|
33
|
-
/* @__PURE__ */
|
|
44
|
+
((x = o.sponsor) == null ? void 0 : x.logo) && o.logoMode === i.LEFT && /* @__PURE__ */ e(po, { children: (P = o.sponsor) == null ? void 0 : P.name }),
|
|
45
|
+
/* @__PURE__ */ t(co, { className: "SponsorText", children: [
|
|
34
46
|
/* @__PURE__ */ e(yo, { children: "AD" }),
|
|
35
|
-
/* @__PURE__ */ e(
|
|
47
|
+
/* @__PURE__ */ e(uo, { children: "SPONSORED" })
|
|
36
48
|
] })
|
|
37
49
|
]
|
|
38
50
|
}
|
|
39
51
|
)
|
|
40
52
|
] }),
|
|
41
53
|
/* @__PURE__ */ e(
|
|
42
|
-
|
|
54
|
+
ro,
|
|
43
55
|
{
|
|
44
56
|
className: "ClosePromoIcon",
|
|
45
|
-
close:
|
|
46
|
-
autoClose: (
|
|
47
|
-
duration:
|
|
48
|
-
isPlaying:
|
|
57
|
+
close: X,
|
|
58
|
+
autoClose: (B = o.closeTimer) == null ? void 0 : B.auto,
|
|
59
|
+
duration: Q ? 0 : (C = o.closeTimer) == null ? void 0 : C.seconds,
|
|
60
|
+
isPlaying: !K
|
|
49
61
|
}
|
|
50
62
|
)
|
|
51
63
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */ e(J, { children: (
|
|
55
|
-
|
|
64
|
+
/* @__PURE__ */ t(fo, { children: [
|
|
65
|
+
m && /* @__PURE__ */ e(z, { className: bo, src: (E = o.sponsor) == null ? void 0 : E.logo, alt: "promo" }),
|
|
66
|
+
/* @__PURE__ */ e(J, { children: (O = (g = o.banner) == null ? void 0 : g.video) != null && O.url ? /* @__PURE__ */ e(
|
|
67
|
+
to,
|
|
56
68
|
{
|
|
57
|
-
source: (
|
|
58
|
-
poster: (
|
|
59
|
-
aspectRatio:
|
|
69
|
+
source: (L = (M = o.banner) == null ? void 0 : M.video) == null ? void 0 : L.url,
|
|
70
|
+
poster: (I = (S = o.banner) == null ? void 0 : S.video) == null ? void 0 : I.thumbnailUrl,
|
|
71
|
+
aspectRatio: d ? "1/1" : "16/9",
|
|
60
72
|
onPause: () => {
|
|
61
|
-
|
|
73
|
+
p && (r == null || r(!0));
|
|
62
74
|
},
|
|
63
75
|
onPlay: () => {
|
|
64
|
-
|
|
76
|
+
Z.emit("advertisement", {
|
|
65
77
|
action: "videoPlay",
|
|
66
78
|
payload: {
|
|
67
|
-
id:
|
|
79
|
+
id: l,
|
|
68
80
|
type: o.type
|
|
69
81
|
}
|
|
70
|
-
}),
|
|
82
|
+
}), r == null || r(!1);
|
|
71
83
|
},
|
|
72
|
-
controlVideo:
|
|
73
|
-
autoPlay:
|
|
84
|
+
controlVideo: n,
|
|
85
|
+
autoPlay: p
|
|
74
86
|
}
|
|
75
|
-
) : (
|
|
76
|
-
!
|
|
77
|
-
((
|
|
78
|
-
((
|
|
87
|
+
) : (D = o.banner) != null && D.imageUrl ? /* @__PURE__ */ e(ho, { style: d ? { aspectRatio: "1/1" } : {}, src: (R = o.banner) == null ? void 0 : R.imageUrl, alt: "promo" }) : null }),
|
|
88
|
+
!d && /* @__PURE__ */ t(J, { children: [
|
|
89
|
+
((U = o.banner) == null ? void 0 : U.title) && /* @__PURE__ */ e(Ao, { className: $("AdvTitle", m && To), children: (_ = o.banner) == null ? void 0 : _.title }),
|
|
90
|
+
((k = o.banner) == null ? void 0 : k.body) && /* @__PURE__ */ e(vo, { className: "AdvDescription", children: (F = o.banner) == null ? void 0 : F.body })
|
|
79
91
|
] })
|
|
80
92
|
] }),
|
|
81
|
-
o.buttonType !==
|
|
82
|
-
|
|
93
|
+
o.buttonType !== eo.NO_BUTTON && /* @__PURE__ */ e(No, { children: /* @__PURE__ */ e(
|
|
94
|
+
xo,
|
|
83
95
|
{
|
|
84
|
-
href:
|
|
96
|
+
href: a,
|
|
85
97
|
style: {
|
|
86
|
-
backgroundColor: ((
|
|
87
|
-
color: ((
|
|
98
|
+
backgroundColor: ((j = (V = o.banner) == null ? void 0 : V.ctaButton) == null ? void 0 : j.color) || "#009dc4",
|
|
99
|
+
color: ((H = (G = o.banner) == null ? void 0 : G.ctaButton) == null ? void 0 : H.textColor) || "#fff"
|
|
88
100
|
},
|
|
89
101
|
"data-analytics": "button",
|
|
90
|
-
"data-promo-id":
|
|
102
|
+
"data-promo-id": l,
|
|
91
103
|
"data-promo-type": o.type,
|
|
92
104
|
target: "_blank",
|
|
93
|
-
children: (
|
|
105
|
+
children: (W = (w = o.banner) == null ? void 0 : w.ctaButton) == null ? void 0 : W.label
|
|
94
106
|
}
|
|
95
107
|
) })
|
|
96
108
|
] });
|
|
97
109
|
};
|
|
98
110
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
Io as Overlay,
|
|
112
|
+
Uo as OverlayContainer
|
|
101
113
|
};
|
|
@@ -1,37 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { QuestionTypeData as
|
|
4
|
-
import { Insight as
|
|
5
|
-
import { Container as
|
|
6
|
-
import { Tweet as
|
|
7
|
-
const
|
|
8
|
-
close:
|
|
1
|
+
import { jsxs as m, jsx as a, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as o } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { QuestionTypeData as f } from "../../constants.js";
|
|
4
|
+
import { Insight as E } from "./insight/index.js";
|
|
5
|
+
import { Container as I, CloseIconWrap as h, CloseIcon as C, Header as A, TypeIcon as W, TypeName as s, Question as x, AnswerButton as D } from "./styles.js";
|
|
6
|
+
import { Tweet as g } from "./tweet/index.js";
|
|
7
|
+
const w = ({
|
|
8
|
+
close: i,
|
|
9
9
|
action: n,
|
|
10
10
|
controlVideo: c,
|
|
11
|
-
data: { questionType: r, question:
|
|
11
|
+
data: { questionType: r, question: t, insight: e, tweet: p }
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
/* @__PURE__ */ a(
|
|
16
|
-
|
|
13
|
+
const l = f[r];
|
|
14
|
+
return l ? /* @__PURE__ */ m(I, { onClick: n, style: r === o.TWEET ? { paddingTop: "12px" } : {}, children: [
|
|
15
|
+
/* @__PURE__ */ a(
|
|
16
|
+
h,
|
|
17
|
+
{
|
|
18
|
+
onClick: (d) => {
|
|
19
|
+
d.stopPropagation(), i && i(d);
|
|
20
|
+
},
|
|
21
|
+
children: /* @__PURE__ */ a(C, { name: "icon-cross" })
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
r !== o.TWEET && /* @__PURE__ */ m(A, { children: [
|
|
17
25
|
/* @__PURE__ */ a(
|
|
18
|
-
|
|
26
|
+
W,
|
|
19
27
|
{
|
|
20
|
-
"data-type-trivia": r ===
|
|
21
|
-
"data-type-poll": r ===
|
|
22
|
-
name:
|
|
28
|
+
"data-type-trivia": r === o.TRIVIA,
|
|
29
|
+
"data-type-poll": r === o.POLL,
|
|
30
|
+
name: l.iconName
|
|
23
31
|
}
|
|
24
32
|
),
|
|
25
|
-
/* @__PURE__ */ a(
|
|
33
|
+
/* @__PURE__ */ a(s, { children: l.label })
|
|
26
34
|
] }),
|
|
27
|
-
r ===
|
|
28
|
-
r ===
|
|
29
|
-
r !==
|
|
30
|
-
/* @__PURE__ */ a(
|
|
31
|
-
/* @__PURE__ */ a(
|
|
35
|
+
r === o.FACTOID && e && /* @__PURE__ */ a(E, { ...e, action: n, controlVideo: c }),
|
|
36
|
+
r === o.TWEET && p && /* @__PURE__ */ a(g, { ...p, action: n, controlVideo: c }),
|
|
37
|
+
r !== o.FACTOID && r !== o.TWEET && /* @__PURE__ */ m(T, { children: [
|
|
38
|
+
/* @__PURE__ */ a(x, { children: t == null ? void 0 : t.title }),
|
|
39
|
+
/* @__PURE__ */ a(D, { children: "Answer" })
|
|
32
40
|
] })
|
|
33
41
|
] }) : null;
|
|
34
42
|
};
|
|
35
43
|
export {
|
|
36
|
-
|
|
44
|
+
w as Notification
|
|
37
45
|
};
|
|
@@ -1,95 +1,97 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { QuestionImages as a, QuestionType as
|
|
4
|
-
import { AnimatedCounter as
|
|
5
|
-
import { IconDefault as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useLayoutEffect as W } from "react";
|
|
3
|
+
import { QuestionImages as a, QuestionType as o, QuestionStatus as p } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
|
|
5
|
+
import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as z, ButtonContainer as G, ButtonPctWrap as H, ButtonPct as J, ButtonBody as K, Title as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
|
|
6
6
|
const E = {
|
|
7
|
-
[a.CENTERED]: (t) => /* @__PURE__ */ e(
|
|
7
|
+
[a.CENTERED]: (t) => /* @__PURE__ */ e(y, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
8
8
|
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
|
|
9
9
|
[a.ROUNDED]: (t) => /* @__PURE__ */ e(z, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
10
10
|
[a.NONE]: () => null,
|
|
11
11
|
[a.UNSET]: () => null
|
|
12
|
-
}, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted:
|
|
13
|
-
if (t ===
|
|
12
|
+
}, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
|
|
13
|
+
if (t === o.POLL && r)
|
|
14
14
|
return "voted";
|
|
15
|
-
if (t ===
|
|
16
|
-
if (c &&
|
|
17
|
-
return
|
|
18
|
-
if (
|
|
15
|
+
if (t === o.PREDICTION) {
|
|
16
|
+
if (!c && i)
|
|
17
|
+
return r ? "voted" : "unset";
|
|
18
|
+
if (c && i)
|
|
19
|
+
return r ? n ? "correct" : "incorrect" : "unset";
|
|
20
|
+
if (r)
|
|
19
21
|
return "correct";
|
|
20
22
|
}
|
|
21
|
-
return t ===
|
|
23
|
+
return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
|
|
22
24
|
}, et = ({
|
|
23
25
|
questionType: t,
|
|
24
26
|
questionVoted: c,
|
|
25
27
|
correct: n,
|
|
26
|
-
hasCorrectAnswer:
|
|
27
|
-
questionStatus:
|
|
28
|
-
}) => t ===
|
|
29
|
-
var
|
|
28
|
+
hasCorrectAnswer: r,
|
|
29
|
+
questionStatus: i
|
|
30
|
+
}) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === p.RESOLVED && n : !1, st = (t) => {
|
|
31
|
+
var S;
|
|
30
32
|
const {
|
|
31
33
|
// option props
|
|
32
34
|
id: c,
|
|
33
35
|
icon: n,
|
|
34
|
-
text:
|
|
35
|
-
percentageDecimal:
|
|
36
|
-
points:
|
|
36
|
+
text: r,
|
|
37
|
+
percentageDecimal: i,
|
|
38
|
+
points: D,
|
|
37
39
|
// extra props
|
|
38
|
-
onVote:
|
|
39
|
-
markThatVoted:
|
|
40
|
-
onPercentsAnimated:
|
|
41
|
-
youSelected:
|
|
42
|
-
youVoted:
|
|
40
|
+
onVote: v,
|
|
41
|
+
markThatVoted: O,
|
|
42
|
+
onPercentsAnimated: f,
|
|
43
|
+
youSelected: h,
|
|
44
|
+
youVoted: g,
|
|
43
45
|
questionVoted: s,
|
|
44
46
|
imageMode: C,
|
|
45
|
-
answerTimeExpired:
|
|
47
|
+
answerTimeExpired: w,
|
|
46
48
|
questionStatus: P,
|
|
47
|
-
isLoading:
|
|
49
|
+
isLoading: A,
|
|
48
50
|
questionType: d,
|
|
49
|
-
correct:
|
|
50
|
-
hasCorrectAnswer:
|
|
51
|
-
votedAfterQuestionClosed:
|
|
51
|
+
correct: k,
|
|
52
|
+
hasCorrectAnswer: x,
|
|
53
|
+
votedAfterQuestionClosed: L,
|
|
52
54
|
enteredAnActiveQuestion: R,
|
|
53
|
-
marketClosed:
|
|
54
|
-
} = t, [
|
|
55
|
-
return
|
|
55
|
+
marketClosed: I
|
|
56
|
+
} = t, [B, T] = V(0), m = tt(t), Q = et({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: x, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, b = d === o.PREDICTION && !s && !I, j = s && !h && m !== "incorrect" && !g;
|
|
57
|
+
return W(() => {
|
|
56
58
|
T(0), requestAnimationFrame(() => {
|
|
57
|
-
T(
|
|
59
|
+
T(i);
|
|
58
60
|
});
|
|
59
|
-
}, [
|
|
61
|
+
}, [i]), /* @__PURE__ */ l(
|
|
60
62
|
G,
|
|
61
63
|
{
|
|
62
64
|
value: c,
|
|
63
|
-
"data-selected":
|
|
64
|
-
"data-answer-state":
|
|
65
|
-
disabled: s ||
|
|
66
|
-
"data-is-not-checked":
|
|
67
|
-
onClick: (
|
|
68
|
-
|
|
69
|
-
d ===
|
|
70
|
-
),
|
|
65
|
+
"data-selected": h,
|
|
66
|
+
"data-answer-state": m,
|
|
67
|
+
disabled: s || A || w || u && !R || u && R && L,
|
|
68
|
+
"data-is-not-checked": j,
|
|
69
|
+
onClick: (U) => {
|
|
70
|
+
O(
|
|
71
|
+
d === o.PREDICTION ? I : P === p.RESOLVED
|
|
72
|
+
), v(U);
|
|
71
73
|
},
|
|
72
74
|
children: [
|
|
73
75
|
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
|
74
76
|
J,
|
|
75
77
|
{
|
|
76
|
-
"data-answer-state":
|
|
77
|
-
style: { width: `${N ?
|
|
78
|
+
"data-answer-state": m,
|
|
79
|
+
style: { width: `${N ? B : 0}%` },
|
|
78
80
|
onTransitionEnd: () => {
|
|
79
|
-
u ||
|
|
81
|
+
u || f == null || f();
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
) }),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
n && C && ((
|
|
85
|
-
/* @__PURE__ */ e(X, { children:
|
|
86
|
-
b && /* @__PURE__ */
|
|
87
|
-
|
|
85
|
+
/* @__PURE__ */ l(K, { children: [
|
|
86
|
+
n && C && ((S = E[C]) == null ? void 0 : S.call(E, n)),
|
|
87
|
+
/* @__PURE__ */ e(X, { children: r }),
|
|
88
|
+
b && /* @__PURE__ */ l("div", { children: [
|
|
89
|
+
D,
|
|
88
90
|
/* @__PURE__ */ e(Y, { children: "pts" })
|
|
89
91
|
] }),
|
|
90
|
-
N && /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(
|
|
92
|
+
N && /* @__PURE__ */ l(Z, { children: [
|
|
93
|
+
Q && /* @__PURE__ */ e(_, { name: "selected" }),
|
|
94
|
+
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
|
|
93
95
|
] })
|
|
94
96
|
] })
|
|
95
97
|
]
|
|
@@ -52,6 +52,9 @@ export declare const COLORS: {
|
|
|
52
52
|
VOTE_BTN_NOT_SELECTED_BORDER: string;
|
|
53
53
|
VOTE_BTN_SELECTED_BG: string;
|
|
54
54
|
VOTE_BTN_NOT_SELECTED_BG: string;
|
|
55
|
+
VOTE_BTN_NOT_SELECTED_BG_UNSET: string;
|
|
56
|
+
VOTED_ANSWER_BG: string;
|
|
57
|
+
VOTED_BTN_RCT_BG: string;
|
|
55
58
|
};
|
|
56
59
|
export declare const COLORS_ADVERTISEMENT: {
|
|
57
60
|
BG_PRIMARY: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const R = {
|
|
2
2
|
BLUE_QUESTION_ACTION_BTN: "#1589ee",
|
|
3
3
|
WHITE: "#FFFFFF",
|
|
4
4
|
BLUE: "#2d6ffd",
|
|
@@ -36,7 +36,7 @@ const T = {
|
|
|
36
36
|
SDK_PREDICTION_FEEDBACK_SUCCESS_ICON: "#107D57",
|
|
37
37
|
SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1: "#CD2525",
|
|
38
38
|
SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2: "#fff",
|
|
39
|
-
PREDICTION_BG_LINES_CORRECT: "#
|
|
39
|
+
PREDICTION_BG_LINES_CORRECT: "#01AB58",
|
|
40
40
|
PREDICTION_BG_LINES_INCORRECT: "#888B8D",
|
|
41
41
|
SKELETON_COLOR_1: "#f1efef",
|
|
42
42
|
SKELETON_COLOR_2: "#f9f8f8",
|
|
@@ -48,12 +48,15 @@ const T = {
|
|
|
48
48
|
CARD_BORDER: "#fff",
|
|
49
49
|
BORDER: "#E8E8E8",
|
|
50
50
|
VOTE_BTN_BG: "#F7F7F7",
|
|
51
|
-
VOTE_BTN_BORDER: "
|
|
51
|
+
VOTE_BTN_BORDER: "rgb(232, 232, 232)",
|
|
52
52
|
VOTE_BTN_DISABLED_BORDER: "#B1B3B3",
|
|
53
53
|
VOTE_BTN_SELECTED_BORDER: "#25282A",
|
|
54
54
|
VOTE_BTN_NOT_SELECTED_BORDER: "#E8E8E8",
|
|
55
55
|
VOTE_BTN_SELECTED_BG: "#FFFFFF",
|
|
56
|
-
VOTE_BTN_NOT_SELECTED_BG: "#FFFFFF"
|
|
56
|
+
VOTE_BTN_NOT_SELECTED_BG: "#FFFFFF",
|
|
57
|
+
VOTE_BTN_NOT_SELECTED_BG_UNSET: "rgb(196, 196, 196)",
|
|
58
|
+
VOTED_ANSWER_BG: "#FFFFFF",
|
|
59
|
+
VOTED_BTN_RCT_BG: "#2d5694"
|
|
57
60
|
}, F = {
|
|
58
61
|
BG_PRIMARY: "#13212b",
|
|
59
62
|
BG_SECONDARY: "#152430",
|
|
@@ -64,7 +67,7 @@ const T = {
|
|
|
64
67
|
TEXT_SECONDARY: "rgba(255, 255, 255, 0.8)",
|
|
65
68
|
TEXT_SECONDARY1: "#878787",
|
|
66
69
|
WHITE: "#fff"
|
|
67
|
-
}, D = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"],
|
|
70
|
+
}, D = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"], O = "#cee5de", S = "#f9d6d8", I = "#E8E8E8", A = {
|
|
68
71
|
REGULAR: "'SF Pro Text', Arial, Helvetica, sans-serif",
|
|
69
72
|
SERIF: "'SF Pro Display', Arial, Helvetica, sans-serif",
|
|
70
73
|
COLOR: "#fff",
|
|
@@ -77,33 +80,33 @@ const T = {
|
|
|
77
80
|
SIZE_DEFAULT2: "12px",
|
|
78
81
|
LINE_HEIGHT: "24px",
|
|
79
82
|
MARGIN_TITLE_DEFAULT: "24px 0px"
|
|
80
|
-
},
|
|
83
|
+
}, N = {
|
|
81
84
|
xs: 324,
|
|
82
85
|
sm: 576,
|
|
83
86
|
md: 768,
|
|
84
87
|
lg: 992,
|
|
85
88
|
xl: 1200,
|
|
86
89
|
xxl: 1440
|
|
87
|
-
},
|
|
90
|
+
}, C = {
|
|
88
91
|
landscape: "landscape",
|
|
89
92
|
portrait: "portrait"
|
|
90
|
-
}, B = Object.entries(
|
|
93
|
+
}, B = Object.entries(R).reduce((E, [_, T]) => `
|
|
91
94
|
${E}
|
|
92
|
-
--color-${_.toLowerCase().replaceAll("_", "-")}: ${
|
|
93
|
-
`, ""), L = Object.entries(F).reduce((E, [_,
|
|
95
|
+
--color-${_.toLowerCase().replaceAll("_", "-")}: ${T};
|
|
96
|
+
`, ""), L = Object.entries(F).reduce((E, [_, T]) => `
|
|
94
97
|
${E}
|
|
95
|
-
--color-adv-${_.toLowerCase().replaceAll("_", "-")}: ${
|
|
98
|
+
--color-adv-${_.toLowerCase().replaceAll("_", "-")}: ${T};
|
|
96
99
|
`, "");
|
|
97
100
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
N as BREAKPOINTS,
|
|
102
|
+
R as COLORS,
|
|
100
103
|
F as COLORS_ADVERTISEMENT,
|
|
101
104
|
A as FONT,
|
|
102
|
-
|
|
105
|
+
C as ORIENTATION,
|
|
103
106
|
D as TIMER_COLORS,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
I as TIMER_GRAY,
|
|
108
|
+
O as TIMER_GREEN,
|
|
109
|
+
S as TIMER_RED,
|
|
107
110
|
B as colors,
|
|
108
111
|
L as colorsAdvertisement
|
|
109
112
|
};
|