@streamlayer/react-ui 0.97.1 → 0.98.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/assets/style.css +1 -1
- package/lib/hooks/analytics.js +2 -2
- package/lib/ui/app/Features/Gamification/UserSummary.js +11 -11
- package/lib/ui/app/Features/Gamification/gamification-feature.js +2 -2
- package/lib/ui/app/Features/Gamification/index.js +42 -44
- package/lib/ui/app/Features/index.js +2 -2
- package/lib/ui/app/Notifications/Onboarding/index.js +7 -8
- package/lib/ui/app/Notifications/index.js +123 -103
- package/lib/ui/app/Points/index.js +14 -14
- package/lib/ui/app/masters.js +26 -28
- package/lib/ui/app/useMastersApp.js +25 -23
- package/lib/ui/gamification/vote/feedback/index.d.ts +1 -1
- package/lib/ui/gamification/vote/feedback/index.js +64 -73
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +29 -24
- package/lib/ui/gamification/vote/index.js +107 -97
- package/lib/ui/gamification/vote/vote-option/index.js +54 -52
- package/lib/ui/gamification/vote/win-bar/index.d.ts +2 -0
- package/lib/ui/gamification/vote/win-bar/index.js +44 -25
- package/lib/ui/gamification/vote/win-bar/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/win-bar/styles.js +28 -21
- package/lib/ui/modal/index.d.ts +0 -1
- package/lib/ui/modal/index.js +47 -37
- package/lib/ui/show-in/index.d.ts +7 -3
- package/lib/ui/show-in/index.js +43 -21
- package/lib/ui/theme/constants.js +1 -1
- package/lib/ui/theme/theme.js +16 -14
- package/package.json +10 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { QuestionType as
|
|
4
|
-
import { ExpiredAlert as
|
|
5
|
-
import { Feedback as
|
|
6
|
-
import { QuestionScrollContainer as
|
|
7
|
-
import { VotingOption as
|
|
8
|
-
import { WinBar as
|
|
1
|
+
import { jsx as a, jsxs as j, Fragment as st } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as F, useState as c, useEffect as v, useCallback as q, useMemo as u } from "react";
|
|
3
|
+
import { QuestionType as o, QuestionStatus as x } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { ExpiredAlert as ot } from "./expired-alert/index.js";
|
|
5
|
+
import { Feedback as nt } from "./feedback/index.js";
|
|
6
|
+
import { QuestionScrollContainer as at, Container as ct, Content as mt, Title as lt, Options as ut } from "./styles.js";
|
|
7
|
+
import { VotingOption as ft } from "./vote-option/index.js";
|
|
8
|
+
import { WinBar as dt } from "./win-bar/index.js";
|
|
9
9
|
import "../../icons/index.js";
|
|
10
10
|
import "@linaria/react";
|
|
11
11
|
import "./expired-alert/styles.js";
|
|
@@ -20,132 +20,142 @@ import "../../timer/index.js";
|
|
|
20
20
|
import "react-countdown-circle-timer";
|
|
21
21
|
import "../../theme/constants.js";
|
|
22
22
|
import "./win-bar/styles.js";
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const Tt = (t, d) => {
|
|
24
|
+
switch (t) {
|
|
25
|
+
case "already_voted":
|
|
26
|
+
return d === o.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally.";
|
|
27
|
+
default:
|
|
28
|
+
return "Something went wrong, please try again";
|
|
29
|
+
}
|
|
30
|
+
}, Lt = ({ openedQuestion: t, isLoading: d, vote: N, close: y }) => {
|
|
31
|
+
var W, Y;
|
|
32
|
+
const H = t.subject, e = t.type, T = t.status, E = (W = t.options) == null ? void 0 : W.options, I = t.marketClosed, V = t.id, S = F(), [h, _] = c(!1), [w, z] = c(!1), [C, k] = c(!0), [m, G] = c(!1), [M, R] = c(""), [g, J] = c(""), [O, b] = c(!1), [K, U] = c(!1);
|
|
33
|
+
v(() => {
|
|
34
|
+
e === o.PREDICTION ? I && k(!1) : T === x.RESOLVED && k(!1);
|
|
30
35
|
}, []);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
}, []),
|
|
34
|
-
async (
|
|
35
|
-
if (!
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const X = q((s) => {
|
|
37
|
+
z(s), _(!0);
|
|
38
|
+
}, []), P = F(!1), L = q(
|
|
39
|
+
async (s) => {
|
|
40
|
+
if (!P.current && (P.current = !0, V)) {
|
|
41
|
+
const l = s.currentTarget.value;
|
|
42
|
+
R(l);
|
|
38
43
|
try {
|
|
39
|
-
await
|
|
40
|
-
} catch (
|
|
41
|
-
|
|
42
|
-
H(Q), v(""), console.error("Error while voting", j), R.current = !1;
|
|
44
|
+
await N(V, l);
|
|
45
|
+
} catch (p) {
|
|
46
|
+
J(Tt(p.message, e)), R(""), console.error("Error while voting", p), P.current = !1;
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
},
|
|
46
|
-
[
|
|
47
|
-
),
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
() => t == null ? void 0 : t.answers.find((
|
|
50
|
+
[e, V, R, N]
|
|
51
|
+
), Z = q(() => {
|
|
52
|
+
G(!0), setTimeout(y, 3e3);
|
|
53
|
+
}, [y]), r = u(
|
|
54
|
+
() => t == null ? void 0 : t.answers.find((s) => s.youVoted === !0),
|
|
51
55
|
[t]
|
|
52
|
-
),
|
|
53
|
-
() => !!(t != null && t.answers.find((
|
|
56
|
+
), n = u(
|
|
57
|
+
() => !!(t != null && t.answers.find((s) => s.correct === !0)),
|
|
54
58
|
[t]
|
|
55
|
-
),
|
|
56
|
-
() => t == null ? void 0 : t.answers.find((
|
|
59
|
+
), i = u(
|
|
60
|
+
() => t == null ? void 0 : t.answers.find((s) => s.correct === !0),
|
|
57
61
|
[t]
|
|
58
62
|
);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var d;
|
|
63
|
+
v(() => {
|
|
64
|
+
e === o.PREDICTION && r && h && !K && (S.current = setTimeout(y, 1e4), U(!0));
|
|
65
|
+
}, [r]), v(() => () => {
|
|
66
|
+
clearTimeout(S.current);
|
|
67
|
+
}, []);
|
|
68
|
+
const A = u(() => t ? t.answers.map((s) => {
|
|
69
|
+
var l;
|
|
67
70
|
return {
|
|
68
|
-
...
|
|
71
|
+
...s,
|
|
69
72
|
questionVoted: !!r,
|
|
70
|
-
youSelected:
|
|
71
|
-
isLoading:
|
|
72
|
-
hasCorrectAnswer:
|
|
73
|
+
youSelected: M === s.id,
|
|
74
|
+
isLoading: d,
|
|
75
|
+
hasCorrectAnswer: n,
|
|
73
76
|
questionType: t.type,
|
|
74
|
-
answerTimeExpired:
|
|
75
|
-
questionStatus:
|
|
76
|
-
imageMode: (
|
|
77
|
-
onVote:
|
|
77
|
+
answerTimeExpired: m,
|
|
78
|
+
questionStatus: T,
|
|
79
|
+
imageMode: (l = t.appearance) == null ? void 0 : l.images,
|
|
80
|
+
onVote: L
|
|
78
81
|
};
|
|
79
82
|
}) : [], [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
n,
|
|
84
|
+
m,
|
|
85
|
+
d,
|
|
83
86
|
t,
|
|
84
87
|
r,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
])
|
|
89
|
-
|
|
88
|
+
T,
|
|
89
|
+
L,
|
|
90
|
+
M
|
|
91
|
+
]);
|
|
92
|
+
v(() => {
|
|
93
|
+
const s = A.some(({ percentageDecimal: p }) => p !== 0), l = r && e === o.PREDICTION;
|
|
94
|
+
g && (!s || I && l) && b(!0);
|
|
95
|
+
}, [A, g, I, e, r]);
|
|
96
|
+
const $ = E && (E.case === "trivia" || E.case === "prediction") ? E.value : void 0, f = T === x.RESOLVED && e === o.TRIVIA && !r && !C, B = e === o.TRIVIA && w, D = u(() => e === o.PREDICTION ? !!(r && !n || r && n && (i != null && i.youVoted)) : !0, [e, r, n, i]), Q = u(() => {
|
|
97
|
+
if (e === o.PREDICTION && r && (!n || n && (i != null && i.youVoted)))
|
|
90
98
|
return r.points;
|
|
91
|
-
if (!(f ||
|
|
92
|
-
return r ? r.correct ? r.pointsEarned : 0 :
|
|
93
|
-
}, [
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
99
|
+
if (!(f || m))
|
|
100
|
+
return r ? r.correct ? r.pointsEarned : 0 : i == null ? void 0 : i.points;
|
|
101
|
+
}, [m, r, i, f, e, n]), tt = u(() => e === o.PREDICTION && r ? n ? n && (i != null && i.youVoted) ? "You won" : "" : "To win" : f || m ? "Time expired" : e === o.POLL ? "Time remaining" : r ? "You won" : "To win", [m, e, r, f, n, i]), rt = !D || D && e === o.PREDICTION && h && !O, et = (e === o.TRIVIA || e === o.PREDICTION) && r && n && (i == null ? void 0 : i.youVoted), it = r || f || B || e === o.TRIVIA && T === x.RESOLVED && C;
|
|
102
|
+
return /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(ct, { children: /* @__PURE__ */ j(mt, { children: [
|
|
103
|
+
/* @__PURE__ */ a(
|
|
104
|
+
nt,
|
|
97
105
|
{
|
|
98
|
-
feedbackMessages:
|
|
106
|
+
feedbackMessages: $,
|
|
99
107
|
questionVoted: !!r,
|
|
100
108
|
questionVotedCorrectly: r == null ? void 0 : r.correct,
|
|
101
|
-
questionType:
|
|
102
|
-
hasCorrectAnswer:
|
|
109
|
+
questionType: e,
|
|
110
|
+
hasCorrectAnswer: n,
|
|
103
111
|
showExpiredNotification: f,
|
|
104
|
-
showClosedNotificationTrivia:
|
|
105
|
-
votedInCurrentRender:
|
|
106
|
-
votedAfterQuestionClosed:
|
|
107
|
-
enteredAnActiveQuestion:
|
|
108
|
-
marketClosed:
|
|
109
|
-
percentsAnimated:
|
|
110
|
-
voteErrorMessage:
|
|
112
|
+
showClosedNotificationTrivia: B,
|
|
113
|
+
votedInCurrentRender: h,
|
|
114
|
+
votedAfterQuestionClosed: w,
|
|
115
|
+
enteredAnActiveQuestion: C,
|
|
116
|
+
marketClosed: I,
|
|
117
|
+
percentsAnimated: O,
|
|
118
|
+
voteErrorMessage: g
|
|
111
119
|
}
|
|
112
120
|
),
|
|
113
|
-
|
|
114
|
-
|
|
121
|
+
D && /* @__PURE__ */ a(
|
|
122
|
+
dt,
|
|
115
123
|
{
|
|
116
|
-
title:
|
|
117
|
-
points:
|
|
118
|
-
onTimerExpired:
|
|
124
|
+
title: tt,
|
|
125
|
+
points: Q,
|
|
126
|
+
onTimerExpired: Z,
|
|
119
127
|
questionType: t.type,
|
|
120
|
-
isTimer: !
|
|
128
|
+
isTimer: !d,
|
|
121
129
|
isPlayingTimer: !r,
|
|
122
|
-
animatePoints:
|
|
123
|
-
timerDuration:
|
|
130
|
+
animatePoints: et,
|
|
131
|
+
timerDuration: it ? 0 : Number(((Y = t == null ? void 0 : t.appearance) == null ? void 0 : Y.autoHideInterval) || "30"),
|
|
132
|
+
votedInCurrentRender: h,
|
|
133
|
+
percentsAnimated: O
|
|
124
134
|
}
|
|
125
135
|
),
|
|
126
|
-
|
|
127
|
-
|
|
136
|
+
m ? /* @__PURE__ */ a(
|
|
137
|
+
ot,
|
|
128
138
|
{
|
|
129
139
|
title: "More to come...",
|
|
130
140
|
description: "Watch for additional enhanced stream interactive experience."
|
|
131
141
|
}
|
|
132
|
-
) : /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
142
|
+
) : /* @__PURE__ */ j(st, { children: [
|
|
143
|
+
/* @__PURE__ */ a(lt, { style: rt ? { marginTop: 0 } : {}, children: H }),
|
|
144
|
+
/* @__PURE__ */ a(ut, { children: A.map((s) => /* @__PURE__ */ a(
|
|
145
|
+
ft,
|
|
136
146
|
{
|
|
137
|
-
...
|
|
138
|
-
markThatVoted:
|
|
139
|
-
onPercentsAnimated: () =>
|
|
140
|
-
votedAfterQuestionClosed:
|
|
141
|
-
enteredAnActiveQuestion:
|
|
142
|
-
marketClosed:
|
|
147
|
+
...s,
|
|
148
|
+
markThatVoted: X,
|
|
149
|
+
onPercentsAnimated: () => b(!0),
|
|
150
|
+
votedAfterQuestionClosed: w,
|
|
151
|
+
enteredAnActiveQuestion: C,
|
|
152
|
+
marketClosed: I
|
|
143
153
|
},
|
|
144
|
-
|
|
154
|
+
s.id
|
|
145
155
|
)) })
|
|
146
156
|
] })
|
|
147
157
|
] }) }) });
|
|
148
158
|
};
|
|
149
159
|
export {
|
|
150
|
-
|
|
160
|
+
Lt as Vote
|
|
151
161
|
};
|
|
@@ -1,95 +1,97 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as j, useLayoutEffect as U } from "react";
|
|
3
|
-
import { QuestionImages as a, QuestionType as o, QuestionStatus as
|
|
3
|
+
import { QuestionImages as a, QuestionType as o, QuestionStatus as S } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
|
|
5
5
|
import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as W, ButtonContainer as z, ButtonPct as G, ButtonBody as H, Title as J, Pts as K, Indicators as X, CheckIcon as Y, Percentage as Z } from "./styles.js";
|
|
6
6
|
import "react-countup";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../../icons/index.js";
|
|
9
|
-
const
|
|
10
|
-
[a.CENTERED]: (t) => /* @__PURE__ */
|
|
11
|
-
[a.TRANSPARENT]: (t) => /* @__PURE__ */
|
|
12
|
-
[a.ROUNDED]: (t) => /* @__PURE__ */
|
|
9
|
+
const E = {
|
|
10
|
+
[a.CENTERED]: (t) => /* @__PURE__ */ e(y, { alt: "option-icon", src: t }),
|
|
11
|
+
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
|
|
12
|
+
[a.ROUNDED]: (t) => /* @__PURE__ */ e(W, { alt: "option-icon", src: t }),
|
|
13
13
|
[a.NONE]: () => null,
|
|
14
14
|
[a.UNSET]: () => null
|
|
15
|
-
}, _ = ({ questionType: t, hasCorrectAnswer: c, correct:
|
|
16
|
-
if (t === o.POLL &&
|
|
15
|
+
}, _ = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
|
|
16
|
+
if (t === o.POLL && r)
|
|
17
17
|
return "correct";
|
|
18
18
|
if (t === o.PREDICTION) {
|
|
19
|
-
if (c &&
|
|
20
|
-
return
|
|
21
|
-
if (
|
|
19
|
+
if (c && i)
|
|
20
|
+
return r ? n ? "correct" : "incorrect" : "unset";
|
|
21
|
+
if (r)
|
|
22
22
|
return "correct";
|
|
23
23
|
}
|
|
24
|
-
return t === o.TRIVIA &&
|
|
24
|
+
return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
|
|
25
25
|
}, q = ({
|
|
26
26
|
questionType: t,
|
|
27
27
|
questionVoted: c,
|
|
28
|
-
correct:
|
|
29
|
-
hasCorrectAnswer:
|
|
30
|
-
questionStatus:
|
|
31
|
-
}) => t === o.TRIVIA ? c &&
|
|
32
|
-
var
|
|
28
|
+
correct: n,
|
|
29
|
+
hasCorrectAnswer: r,
|
|
30
|
+
questionStatus: i
|
|
31
|
+
}) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === S.RESOLVED && n : !1, at = (t) => {
|
|
32
|
+
var N;
|
|
33
33
|
const {
|
|
34
34
|
// option props
|
|
35
35
|
id: c,
|
|
36
|
-
icon:
|
|
37
|
-
text:
|
|
38
|
-
percentageDecimal:
|
|
39
|
-
points:
|
|
36
|
+
icon: n,
|
|
37
|
+
text: r,
|
|
38
|
+
percentageDecimal: i,
|
|
39
|
+
points: D,
|
|
40
40
|
// extra props
|
|
41
|
-
onVote:
|
|
42
|
-
markThatVoted:
|
|
43
|
-
onPercentsAnimated:
|
|
44
|
-
youSelected:
|
|
41
|
+
onVote: w,
|
|
42
|
+
markThatVoted: A,
|
|
43
|
+
onPercentsAnimated: m,
|
|
44
|
+
youSelected: h,
|
|
45
45
|
questionVoted: s,
|
|
46
|
-
imageMode:
|
|
46
|
+
imageMode: C,
|
|
47
47
|
answerTimeExpired: O,
|
|
48
|
-
questionStatus:
|
|
48
|
+
questionStatus: p,
|
|
49
49
|
isLoading: g,
|
|
50
50
|
questionType: d,
|
|
51
51
|
correct: k,
|
|
52
52
|
hasCorrectAnswer: v,
|
|
53
53
|
votedAfterQuestionClosed: x,
|
|
54
54
|
enteredAnActiveQuestion: P,
|
|
55
|
-
marketClosed:
|
|
56
|
-
} = t, [L,
|
|
55
|
+
marketClosed: f
|
|
56
|
+
} = t, [L, R] = j(0), I = _(t), Q = q({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: p }), u = f && d === o.PREDICTION, T = s || u, B = d === o.PREDICTION && !s && !f, V = s && !h && I !== "incorrect";
|
|
57
57
|
return U(() => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
}, [
|
|
58
|
+
R(0), requestAnimationFrame(() => {
|
|
59
|
+
R(i);
|
|
60
|
+
});
|
|
61
|
+
}, [i]), /* @__PURE__ */ l(
|
|
62
62
|
z,
|
|
63
63
|
{
|
|
64
64
|
value: c,
|
|
65
|
-
"data-selected":
|
|
66
|
-
"data-answer-state":
|
|
67
|
-
disabled: s || g || O ||
|
|
65
|
+
"data-selected": h,
|
|
66
|
+
"data-answer-state": I,
|
|
67
|
+
disabled: s || g || O || u && !P || u && P && x,
|
|
68
68
|
"data-is-not-checked": V,
|
|
69
69
|
onClick: (b) => {
|
|
70
|
-
|
|
71
|
-
d === o.PREDICTION ?
|
|
72
|
-
),
|
|
70
|
+
A(
|
|
71
|
+
d === o.PREDICTION ? f : p === S.RESOLVED
|
|
72
|
+
), w(b);
|
|
73
73
|
},
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
76
|
G,
|
|
77
77
|
{
|
|
78
|
-
"data-answer-state":
|
|
79
|
-
style: { width: `${
|
|
80
|
-
onTransitionEnd:
|
|
78
|
+
"data-answer-state": I,
|
|
79
|
+
style: { width: `${T ? L : 0}%` },
|
|
80
|
+
onTransitionEnd: () => {
|
|
81
|
+
u || m == null || m();
|
|
82
|
+
}
|
|
81
83
|
}
|
|
82
84
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
B && /* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ l(H, { children: [
|
|
86
|
+
n && C && ((N = E[C]) == null ? void 0 : N.call(E, n)),
|
|
87
|
+
/* @__PURE__ */ e(J, { children: r }),
|
|
88
|
+
B && /* @__PURE__ */ l("div", { children: [
|
|
89
|
+
D,
|
|
90
|
+
/* @__PURE__ */ e(K, { children: "pts" })
|
|
89
91
|
] }),
|
|
90
|
-
|
|
91
|
-
Q && /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
T && /* @__PURE__ */ l(X, { children: [
|
|
93
|
+
Q && /* @__PURE__ */ e(Y, { name: "selected" }),
|
|
94
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
|
|
93
95
|
] })
|
|
94
96
|
] })
|
|
95
97
|
]
|
|
@@ -8,6 +8,8 @@ interface WinBarProps {
|
|
|
8
8
|
animatePoints?: boolean;
|
|
9
9
|
questionType?: QuestionType;
|
|
10
10
|
timerDuration?: number;
|
|
11
|
+
votedInCurrentRender: boolean;
|
|
12
|
+
percentsAnimated: boolean;
|
|
11
13
|
onTimerExpired?: () => void;
|
|
12
14
|
}
|
|
13
15
|
export declare const WinBar: React.FC<WinBarProps>;
|
|
@@ -1,36 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { AnimatedCounter as
|
|
4
|
-
import { Timer as
|
|
5
|
-
import { WinBarContainer as
|
|
1
|
+
import { jsx as r, jsxs as n, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as t } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { AnimatedCounter as P } from "../../../animated-counter/index.js";
|
|
4
|
+
import { Timer as s } from "../../../timer/index.js";
|
|
5
|
+
import { ShowInContainer as I, WinBarContainer as f, Content as u, Title as O, WinIcon as T, Points as j, PointsCount as x, PointsUnits as y } from "./styles.js";
|
|
6
6
|
import "react-countup";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react-countdown-circle-timer";
|
|
10
10
|
import "../../../theme/constants.js";
|
|
11
11
|
import "../../../icons/index.js";
|
|
12
|
-
|
|
12
|
+
import "../../../show-in/index.js";
|
|
13
|
+
import "@linaria/core";
|
|
14
|
+
const F = ({
|
|
13
15
|
title: e,
|
|
14
|
-
points:
|
|
16
|
+
points: o,
|
|
15
17
|
isPlayingTimer: m,
|
|
16
|
-
isTimer:
|
|
17
|
-
animatePoints:
|
|
18
|
-
questionType:
|
|
18
|
+
isTimer: a,
|
|
19
|
+
animatePoints: c,
|
|
20
|
+
questionType: i,
|
|
19
21
|
timerDuration: d,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
votedInCurrentRender: l,
|
|
23
|
+
percentsAnimated: p,
|
|
24
|
+
onTimerExpired: h
|
|
25
|
+
}) => /* @__PURE__ */ r(
|
|
26
|
+
I,
|
|
27
|
+
{
|
|
28
|
+
enabled: i === t.PREDICTION && l,
|
|
29
|
+
animate: p,
|
|
30
|
+
children: /* @__PURE__ */ n(
|
|
31
|
+
f,
|
|
32
|
+
{
|
|
33
|
+
style: {
|
|
34
|
+
justifyContent: i === t.PREDICTION ? "center" : "space-between"
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ n(u, { children: [
|
|
38
|
+
e && /* @__PURE__ */ r(O, { children: e }),
|
|
39
|
+
o !== void 0 && i !== t.POLL && /* @__PURE__ */ n(C, { children: [
|
|
40
|
+
/* @__PURE__ */ r(T, { name: "icon-trophy" }),
|
|
41
|
+
/* @__PURE__ */ n(j, { children: [
|
|
42
|
+
/* @__PURE__ */ r(x, { children: c ? /* @__PURE__ */ r(P, { value: o, delay: 0.3 }) : o }),
|
|
43
|
+
/* @__PURE__ */ r(y, { children: "PTS" })
|
|
44
|
+
] })
|
|
45
|
+
] })
|
|
46
|
+
] }),
|
|
47
|
+
a && i !== t.PREDICTION && /* @__PURE__ */ r(s, { isPlaying: m, onTimerExpired: h, duration: d })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
);
|
|
34
53
|
export {
|
|
35
|
-
|
|
54
|
+
F as WinBar
|
|
36
55
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const ShowInContainer: any;
|
|
2
3
|
export declare const WinBarContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,42 +1,49 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SvgIcon as n } from "../../../icons/index.js";
|
|
3
|
+
import { GrowingShowIn as o } from "../../../show-in/index.js";
|
|
3
4
|
import "react/jsx-runtime";
|
|
4
5
|
import "react";
|
|
5
|
-
|
|
6
|
+
import "@linaria/core";
|
|
7
|
+
const t = () => o, m = /* @__PURE__ */ s(t())({
|
|
8
|
+
name: "ShowInContainer",
|
|
9
|
+
class: "sie6cqo",
|
|
10
|
+
propsAsIs: !0
|
|
11
|
+
}), I = /* @__PURE__ */ s("div")({
|
|
6
12
|
name: "WinBarContainer",
|
|
7
|
-
class: "
|
|
13
|
+
class: "wgizw4u",
|
|
8
14
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
15
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
10
16
|
name: "Content",
|
|
11
|
-
class: "
|
|
17
|
+
class: "c1l3ucjp",
|
|
12
18
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
19
|
+
}), w = /* @__PURE__ */ s("div")({
|
|
14
20
|
name: "Title",
|
|
15
|
-
class: "
|
|
21
|
+
class: "tx7j799",
|
|
16
22
|
propsAsIs: !1
|
|
17
|
-
}),
|
|
23
|
+
}), i = () => n, A = /* @__PURE__ */ s(i())({
|
|
18
24
|
name: "WinIcon",
|
|
19
|
-
class: "
|
|
25
|
+
class: "w4lwuj0",
|
|
20
26
|
propsAsIs: !0
|
|
21
|
-
}),
|
|
27
|
+
}), C = /* @__PURE__ */ s("div")({
|
|
22
28
|
name: "Points",
|
|
23
|
-
class: "
|
|
29
|
+
class: "po9i64o",
|
|
24
30
|
propsAsIs: !1
|
|
25
|
-
}),
|
|
31
|
+
}), u = /* @__PURE__ */ s("span")({
|
|
26
32
|
name: "PointsCount",
|
|
27
|
-
class: "
|
|
33
|
+
class: "pe5g05h",
|
|
28
34
|
propsAsIs: !1
|
|
29
|
-
}),
|
|
35
|
+
}), d = /* @__PURE__ */ s("span")({
|
|
30
36
|
name: "PointsUnits",
|
|
31
|
-
class: "
|
|
37
|
+
class: "p1hdtpmb",
|
|
32
38
|
propsAsIs: !1
|
|
33
39
|
});
|
|
34
40
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
f as Content,
|
|
42
|
+
C as Points,
|
|
43
|
+
u as PointsCount,
|
|
44
|
+
d as PointsUnits,
|
|
45
|
+
m as ShowInContainer,
|
|
46
|
+
w as Title,
|
|
47
|
+
I as WinBarContainer,
|
|
48
|
+
A as WinIcon
|
|
42
49
|
};
|