@streamlayer/react-ui 1.17.0 → 1.18.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/story/settings/login.js +18 -14
- package/lib/app/login/demo.d.ts +1 -4
- package/lib/app/login/demo.js +38 -24
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +25 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +5 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +7 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +41 -0
- package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.js +13 -0
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +6 -0
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.js +7 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +6 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.js +9 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +5 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +33 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +41 -0
- package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +13 -0
- package/lib/app/masters/BetPack/BetPackContent/constants.js +22 -0
- package/lib/app/masters/BetPack/BetPackContent/index.d.ts +11 -0
- package/lib/app/masters/BetPack/BetPackContent/index.js +116 -0
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +3 -0
- package/lib/app/masters/BetPack/BetPackContent/styles.js +20 -0
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +12 -0
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +9 -0
- package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +10 -0
- package/lib/app/masters/BetPack/BetPackOverlay/styles.js +51 -0
- package/lib/app/masters/BetPack/index.d.ts +14 -0
- package/lib/app/masters/BetPack/index.js +84 -0
- package/lib/app/masters/BetPack/styles.d.ts +4 -0
- package/lib/app/masters/BetPack/styles.js +24 -0
- package/lib/app/masters/BetPack/typings.d.js +1 -0
- package/lib/app/masters/BetPack/utils.d.ts +19 -0
- package/lib/app/masters/BetPack/utils.js +10 -0
- package/lib/app/masters/masters.d.ts +0 -2
- package/lib/app/masters/masters.js +89 -85
- package/lib/app/masters/story/components.d.ts +11 -0
- package/lib/app/masters/story/components.js +151 -0
- package/lib/app/masters/story/index.d.ts +3 -0
- package/lib/app/masters/story/index.js +53 -0
- package/lib/assets/style.css +1 -1
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -1
- package/lib/ui/gamification/vote/feedback/index.js +52 -50
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +5 -0
- package/lib/ui/gamification/vote/index.d.ts +1 -0
- package/lib/ui/gamification/vote/index.js +150 -126
- package/lib/ui/gamification/vote/styles.d.ts +5 -0
- package/lib/ui/gamification/vote/styles.js +40 -14
- package/lib/ui/gamification/vote/vote-option/index.js +43 -40
- package/lib/ui/icons/index.d.ts +5 -0
- package/lib/ui/icons/index.js +87 -66
- package/lib/ui/loader/index.d.ts +4 -0
- package/lib/ui/loader/index.js +5 -0
- package/lib/ui/theme/masters-theme.js +4 -4
- package/lib/ui/theme/masters.js +3 -2
- package/lib/utils/decorators/container.js +11 -9
- package/package.json +22 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuestionType } from '@streamlayer/sdk-web-types';
|
|
1
|
+
import { ExtendedQuestionAnswer, QuestionType } from '@streamlayer/sdk-web-types';
|
|
2
2
|
interface FeedbackProps {
|
|
3
3
|
feedbackMessages?: Partial<Record<'correctFeedback' | 'incorrectFeedback', {
|
|
4
4
|
description: string;
|
|
@@ -16,6 +16,8 @@ interface FeedbackProps {
|
|
|
16
16
|
voteErrorMessage: string;
|
|
17
17
|
marketClosed: boolean;
|
|
18
18
|
percentsAnimated: boolean;
|
|
19
|
+
isEarlyPrediction?: boolean;
|
|
20
|
+
correctAnswer?: ExtendedQuestionAnswer;
|
|
19
21
|
}
|
|
20
22
|
export declare const Feedback: React.FC<FeedbackProps>;
|
|
21
23
|
export {};
|
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
import { ShowInContainer as
|
|
5
|
-
const
|
|
6
|
-
feedbackMessages:
|
|
7
|
-
questionVotedCorrectly:
|
|
8
|
-
questionVoted:
|
|
9
|
-
questionType:
|
|
10
|
-
hasCorrectAnswer:
|
|
11
|
-
showExpiredNotification:
|
|
12
|
-
showClosedNotificationTrivia:
|
|
13
|
-
votedInCurrentRender:
|
|
14
|
-
votedAfterQuestionClosed:
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as l } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { SvgIcon as m } from "../../../icons/index.js";
|
|
4
|
+
import { ShowInContainer as y, Container as H, FeedbackContainer as t, IconPrediction as W, FeedbackDescription as h, FeedbackIconWrap as p, FeedbackHeader as k, FeedbackText as f, EarlyFeedbackDescription as $, DynamicWrap as z, FeedbackTitle as B } from "./styles.js";
|
|
5
|
+
const Z = ({
|
|
6
|
+
feedbackMessages: o,
|
|
7
|
+
questionVotedCorrectly: D,
|
|
8
|
+
questionVoted: F,
|
|
9
|
+
questionType: d,
|
|
10
|
+
hasCorrectAnswer: r,
|
|
11
|
+
showExpiredNotification: T,
|
|
12
|
+
showClosedNotificationTrivia: O,
|
|
13
|
+
votedInCurrentRender: b,
|
|
14
|
+
votedAfterQuestionClosed: j,
|
|
15
15
|
voteErrorMessage: c,
|
|
16
|
-
enteredAnActiveQuestion:
|
|
17
|
-
marketClosed:
|
|
18
|
-
percentsAnimated:
|
|
16
|
+
enteredAnActiveQuestion: P,
|
|
17
|
+
marketClosed: L,
|
|
18
|
+
percentsAnimated: Y,
|
|
19
|
+
isEarlyPrediction: e,
|
|
20
|
+
correctAnswer: u
|
|
19
21
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
c && !
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
22
|
+
const C = F && (d === l.TRIVIA || d === l.PREDICTION), N = d === l.PREDICTION && !r, I = L && d === l.PREDICTION && !F && !P || d === l.PREDICTION && j && b && P, R = C && N, w = C && r, Q = d === l.PREDICTION && F && b && r, S = F && d === l.POLL && b, x = D ? "correct" : "incorrect", a = D ? o == null ? void 0 : o.correctFeedback : o == null ? void 0 : o.incorrectFeedback;
|
|
23
|
+
return T || O || R || w || I || S || Q || c ? /* @__PURE__ */ n(y, { enabled: b, animate: Y, children: /* @__PURE__ */ i(H, { "data-prediction": N, id: "feedbackContainer", children: [
|
|
24
|
+
c && !I && /* @__PURE__ */ i(t, { children: [
|
|
25
|
+
!e && /* @__PURE__ */ n(W, { name: "questionExpired" }),
|
|
26
|
+
/* @__PURE__ */ n(h, { children: c })
|
|
25
27
|
] }),
|
|
26
|
-
!c &&
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
28
|
+
!c && T && /* @__PURE__ */ i(t, { children: [
|
|
29
|
+
!e && /* @__PURE__ */ n(p, { children: /* @__PURE__ */ n(m, { name: "questionExpired" }) }),
|
|
30
|
+
/* @__PURE__ */ i("div", { children: [
|
|
31
|
+
/* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(h, { children: "Question Expired" }) }),
|
|
32
|
+
/* @__PURE__ */ n(f, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
31
33
|
] })
|
|
32
34
|
] }),
|
|
33
|
-
!c &&
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
35
|
+
!c && O && /* @__PURE__ */ i(t, { children: [
|
|
36
|
+
/* @__PURE__ */ n(p, { children: /* @__PURE__ */ n(m, { name: "questionExpired" }) }),
|
|
37
|
+
/* @__PURE__ */ i("div", { children: [
|
|
38
|
+
/* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(h, { children: "Question Closed" }) }),
|
|
39
|
+
/* @__PURE__ */ n(f, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
|
|
38
40
|
] })
|
|
39
41
|
] }),
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
42
|
+
I && /* @__PURE__ */ i(t, { children: [
|
|
43
|
+
!e && /* @__PURE__ */ n(p, { children: /* @__PURE__ */ n(m, { name: "questionExpired" }) }),
|
|
44
|
+
/* @__PURE__ */ i("div", { children: [
|
|
45
|
+
/* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(h, { children: e ? r ? "The results are already in!" : "Question is Closed" : "Question Closed" }) }),
|
|
46
|
+
/* @__PURE__ */ n(f, { id: "feedbackText", children: e ? /* @__PURE__ */ n($, { children: r ? `Correct: ${u == null ? void 0 : u.text}` : "Event affecting the outcome has occurred." }) : "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
|
|
45
47
|
] })
|
|
46
48
|
] }),
|
|
47
|
-
!c &&
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
!c && R && /* @__PURE__ */ i(t, { children: [
|
|
50
|
+
!e && /* @__PURE__ */ n(W, { name: "icon-prediction" }),
|
|
51
|
+
/* @__PURE__ */ i(h, { children: [
|
|
50
52
|
"Your pick has been recorded. ",
|
|
51
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ n(z, { children: "We’ll notify you of the result." })
|
|
52
54
|
] })
|
|
53
55
|
] }),
|
|
54
|
-
!c &&
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
!c && S && /* @__PURE__ */ i(t, { children: [
|
|
57
|
+
!e && /* @__PURE__ */ n(p, { "data-feedback-type": "correct", children: /* @__PURE__ */ n(m, { name: "correct" }) }),
|
|
58
|
+
/* @__PURE__ */ n(h, { children: "Thanks for answering. Please stay tuned for the next question." })
|
|
57
59
|
] }),
|
|
58
|
-
!c && (
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
60
|
+
!c && (w || Q) && /* @__PURE__ */ i(t, { children: [
|
|
61
|
+
!e && /* @__PURE__ */ n(p, { "data-feedback-type": x, children: /* @__PURE__ */ n(m, { name: x }) }),
|
|
62
|
+
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ i(k, { children: [
|
|
63
|
+
/* @__PURE__ */ n(B, { "data-feedback-type": x, children: a == null ? void 0 : a.title }),
|
|
64
|
+
/* @__PURE__ */ n(h, { children: a == null ? void 0 : a.description })
|
|
63
65
|
] }) })
|
|
64
66
|
] })
|
|
65
67
|
] }) }) : null;
|
|
66
68
|
};
|
|
67
69
|
export {
|
|
68
|
-
|
|
70
|
+
Z as Feedback
|
|
69
71
|
};
|
|
@@ -8,3 +8,4 @@ export declare const FeedbackTitle: import('@linaria/react').StyledComponent<imp
|
|
|
8
8
|
export declare const FeedbackDescription: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
9
9
|
export declare const FeedbackText: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
10
10
|
export declare const DynamicWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
11
|
+
export declare const EarlyFeedbackDescription: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -41,10 +41,15 @@ const n = () => a, t = /* @__PURE__ */ s(n())({
|
|
|
41
41
|
name: "DynamicWrap",
|
|
42
42
|
class: "d4i8rro",
|
|
43
43
|
propsAsIs: !1
|
|
44
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
45
|
+
name: "EarlyFeedbackDescription",
|
|
46
|
+
class: "eqyssr",
|
|
47
|
+
propsAsIs: !1
|
|
44
48
|
});
|
|
45
49
|
export {
|
|
46
50
|
d as Container,
|
|
47
51
|
F as DynamicWrap,
|
|
52
|
+
A as EarlyFeedbackDescription,
|
|
48
53
|
i as FeedbackContainer,
|
|
49
54
|
b as FeedbackDescription,
|
|
50
55
|
f as FeedbackHeader,
|
|
@@ -1,167 +1,191 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useHideTransition as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { QuestionType as a, QuestionStatus as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { Alert as
|
|
7
|
-
import { Feedback as
|
|
8
|
-
import { Container as
|
|
9
|
-
import { VotingOption as
|
|
10
|
-
import { WinBar as
|
|
11
|
-
const
|
|
12
|
-
switch (
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { useHideTransition as gt } from "../../../hooks/showIn.js";
|
|
3
|
+
import { useRef as U, useState as c, useEffect as y, useCallback as O, useMemo as g } from "react";
|
|
4
|
+
import { QuestionType as a, QuestionStatus as b } from "@streamlayer/sdk-web-types";
|
|
5
|
+
import { Skeleton as L } from "../../skeleton/index.js";
|
|
6
|
+
import { Alert as It } from "./alert/index.js";
|
|
7
|
+
import { Feedback as X } from "./feedback/index.js";
|
|
8
|
+
import { Container as Z, Content as $, Options as Q, QuestionScrollContainer as Ct, AlertContainer as Vt, EarlyPrediction as yt, EarlyPredictionIcon as vt, Title as pt, OptionsWrap as Et, SponsorLogo as At, SponsorIcon as wt } from "./styles.js";
|
|
9
|
+
import { VotingOption as Rt } from "./vote-option/index.js";
|
|
10
|
+
import { WinBar as Ot } from "./win-bar/index.js";
|
|
11
|
+
const xt = (e, m) => {
|
|
12
|
+
switch (e) {
|
|
13
13
|
case "already_voted":
|
|
14
|
-
return
|
|
14
|
+
return m === a.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.";
|
|
15
15
|
default:
|
|
16
16
|
return "Something went wrong, please try again";
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
] }) }),
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
r === a.PREDICTION ? T && B(!1) :
|
|
18
|
+
}, Yt = () => /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ h($, { children: [
|
|
19
|
+
/* @__PURE__ */ n(L, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
|
|
20
|
+
/* @__PURE__ */ n(L, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
|
|
21
|
+
/* @__PURE__ */ n(Q, { children: Array.from({ length: 5 }).map((e, m) => /* @__PURE__ */ n(L, { loading: !0, style: { height: "44px" } }, m)) })
|
|
22
|
+
] }) }), Bt = ({ openedQuestion: e, isLoading: m, vote: M, close: W, isEarlyPrediction: l }) => {
|
|
23
|
+
var J, K;
|
|
24
|
+
const tt = e.subject, r = e.type, I = e.status, v = (J = e.options) == null ? void 0 : J.options, T = e.marketClosed, x = e.id, Y = U(), [C, et] = c(!1), [p, rt] = c(!1), [V, B] = c(!0), [f, nt] = c(!1), [j, it] = c(!1), [H, S] = c(""), [E, ot] = c(""), [A, F] = c(!1), [st, at] = c(!1), { runAnimation: w, finished: _ } = gt();
|
|
25
|
+
y(() => {
|
|
26
|
+
_ && W();
|
|
27
|
+
}, [W, _]), y(() => {
|
|
28
|
+
r === a.PREDICTION ? T && B(!1) : I === b.RESOLVED && B(!1);
|
|
29
29
|
}, []);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
}, []),
|
|
33
|
-
async (
|
|
34
|
-
if (!
|
|
35
|
-
const
|
|
36
|
-
|
|
30
|
+
const ct = O((o) => {
|
|
31
|
+
rt(o), et(!0);
|
|
32
|
+
}, []), q = U(!1), z = O(
|
|
33
|
+
async (o) => {
|
|
34
|
+
if (!q.current && (q.current = !0, x)) {
|
|
35
|
+
const d = o.currentTarget.value;
|
|
36
|
+
S(d);
|
|
37
37
|
try {
|
|
38
|
-
await
|
|
39
|
-
} catch (
|
|
40
|
-
|
|
38
|
+
await M(x, d);
|
|
39
|
+
} catch (R) {
|
|
40
|
+
ot(xt(R.message, r)), S(""), console.error("Error while voting", R), q.current = !1;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
[r,
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
() =>
|
|
54
|
-
[
|
|
55
|
-
), i = u(
|
|
56
|
-
() => t == null ? void 0 : t.answers.find((n) => n.correct === !0),
|
|
57
|
-
[t]
|
|
44
|
+
[r, x, S, M]
|
|
45
|
+
), lt = O(() => {
|
|
46
|
+
nt(!0), w({ delay: 3500 });
|
|
47
|
+
}, [w]), mt = O(() => {
|
|
48
|
+
it(!0), w({ delay: 3500 });
|
|
49
|
+
}, [w]), t = e == null ? void 0 : e.answers.find((o) => o.youVoted === !0), s = g(
|
|
50
|
+
() => !!(e != null && e.answers.find((o) => o.correct === !0)),
|
|
51
|
+
[e]
|
|
52
|
+
), i = g(
|
|
53
|
+
() => e == null ? void 0 : e.answers.find((o) => o.correct === !0),
|
|
54
|
+
[e]
|
|
58
55
|
);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
clearTimeout(
|
|
56
|
+
y(() => {
|
|
57
|
+
t && C && !st && (Y.current = setTimeout(mt, 1e4), at(!0));
|
|
58
|
+
}, [t]), y(() => () => {
|
|
59
|
+
clearTimeout(Y.current);
|
|
63
60
|
}, []);
|
|
64
|
-
const
|
|
65
|
-
var
|
|
61
|
+
const D = g(() => e ? e.answers.map((o) => {
|
|
62
|
+
var d;
|
|
66
63
|
return {
|
|
67
|
-
...
|
|
68
|
-
questionVoted: !!
|
|
69
|
-
youSelected:
|
|
70
|
-
isLoading:
|
|
71
|
-
hasCorrectAnswer:
|
|
72
|
-
questionType:
|
|
64
|
+
...o,
|
|
65
|
+
questionVoted: !!t,
|
|
66
|
+
youSelected: H === o.id,
|
|
67
|
+
isLoading: m,
|
|
68
|
+
hasCorrectAnswer: s,
|
|
69
|
+
questionType: e.type,
|
|
73
70
|
answerTimeExpired: f,
|
|
74
|
-
questionStatus:
|
|
75
|
-
imageMode: (
|
|
76
|
-
onVote:
|
|
71
|
+
questionStatus: I,
|
|
72
|
+
imageMode: (d = e.appearance) == null ? void 0 : d.images,
|
|
73
|
+
onVote: z
|
|
77
74
|
};
|
|
78
75
|
}) : [], [
|
|
79
|
-
|
|
76
|
+
s,
|
|
80
77
|
f,
|
|
81
|
-
|
|
82
|
-
t,
|
|
78
|
+
m,
|
|
83
79
|
e,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
t,
|
|
81
|
+
I,
|
|
82
|
+
z,
|
|
83
|
+
H
|
|
87
84
|
]);
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
}, [
|
|
92
|
-
const
|
|
93
|
-
if (r === a.PREDICTION &&
|
|
94
|
-
return
|
|
95
|
-
if (!(
|
|
96
|
-
return
|
|
97
|
-
}, [f,
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
85
|
+
y(() => {
|
|
86
|
+
const o = D.some(({ percentageDecimal: R }) => R !== 0), d = t && r === a.PREDICTION;
|
|
87
|
+
E && (!o || T && d) && F(!0);
|
|
88
|
+
}, [D, E, T, r, t]);
|
|
89
|
+
const G = v && (v.case === "trivia" || v.case === "prediction") ? v.value : void 0, u = I === b.RESOLVED && r === a.TRIVIA && !t && !V, P = r === a.TRIVIA && p, k = g(() => r === a.PREDICTION ? l ? !1 : !!(t && !s || t && s && (i != null && i.youVoted)) : !0, [r, t, s, i, l]), ft = g(() => {
|
|
90
|
+
if (r === a.PREDICTION && t && (!s || s && (i != null && i.youVoted)))
|
|
91
|
+
return t.points;
|
|
92
|
+
if (!(u || f))
|
|
93
|
+
return t ? t.correct ? t.pointsEarned : 0 : i == null ? void 0 : i.points;
|
|
94
|
+
}, [f, t, i, u, r, s]), ut = g(() => r === a.PREDICTION && t ? s ? s && (i != null && i.youVoted) ? "You won" : "" : "To win" : u || f ? "Time expired" : r === a.POLL ? "Time remaining" : t ? "You won" : "To win", [f, r, t, u, s, i]), dt = !k || k && r === a.PREDICTION && C && !A, ht = (r === a.TRIVIA || r === a.PREDICTION) && t && s && (i == null ? void 0 : i.youVoted), Tt = t || u || P || r === a.TRIVIA && I === b.RESOLVED && V;
|
|
95
|
+
return /* @__PURE__ */ n(Ct, { children: /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ h($, { children: [
|
|
96
|
+
!l && /* @__PURE__ */ n(
|
|
97
|
+
X,
|
|
101
98
|
{
|
|
102
|
-
feedbackMessages:
|
|
103
|
-
questionVoted: !!
|
|
104
|
-
questionVotedCorrectly:
|
|
99
|
+
feedbackMessages: G,
|
|
100
|
+
questionVoted: !!t,
|
|
101
|
+
questionVotedCorrectly: t == null ? void 0 : t.correct,
|
|
105
102
|
questionType: r,
|
|
106
|
-
hasCorrectAnswer:
|
|
107
|
-
showExpiredNotification:
|
|
108
|
-
showClosedNotificationTrivia:
|
|
109
|
-
votedInCurrentRender:
|
|
110
|
-
votedAfterQuestionClosed:
|
|
111
|
-
enteredAnActiveQuestion:
|
|
103
|
+
hasCorrectAnswer: s,
|
|
104
|
+
showExpiredNotification: u,
|
|
105
|
+
showClosedNotificationTrivia: P,
|
|
106
|
+
votedInCurrentRender: C,
|
|
107
|
+
votedAfterQuestionClosed: p,
|
|
108
|
+
enteredAnActiveQuestion: V,
|
|
112
109
|
marketClosed: T,
|
|
113
|
-
percentsAnimated:
|
|
114
|
-
voteErrorMessage:
|
|
110
|
+
percentsAnimated: A,
|
|
111
|
+
voteErrorMessage: E
|
|
115
112
|
}
|
|
116
113
|
),
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
k && /* @__PURE__ */ n(
|
|
115
|
+
Ot,
|
|
119
116
|
{
|
|
120
|
-
title:
|
|
121
|
-
points:
|
|
122
|
-
onTimerExpired:
|
|
123
|
-
questionType:
|
|
124
|
-
isTimer: !
|
|
125
|
-
isPlayingTimer: !
|
|
126
|
-
animatePoints:
|
|
127
|
-
timerDuration:
|
|
128
|
-
votedInCurrentRender:
|
|
129
|
-
percentsAnimated:
|
|
117
|
+
title: ut,
|
|
118
|
+
points: ft,
|
|
119
|
+
onTimerExpired: lt,
|
|
120
|
+
questionType: e.type,
|
|
121
|
+
isTimer: !m,
|
|
122
|
+
isPlayingTimer: !t,
|
|
123
|
+
animatePoints: ht,
|
|
124
|
+
timerDuration: Tt ? 0 : Number(((K = e == null ? void 0 : e.appearance) == null ? void 0 : K.autoHideInterval) || "30"),
|
|
125
|
+
votedInCurrentRender: C,
|
|
126
|
+
percentsAnimated: A
|
|
130
127
|
}
|
|
131
128
|
),
|
|
132
|
-
f ||
|
|
133
|
-
|
|
129
|
+
!l && (f || j) ? /* @__PURE__ */ n(Vt, { children: /* @__PURE__ */ n(
|
|
130
|
+
It,
|
|
134
131
|
{
|
|
135
132
|
icon: "icon-check-circle",
|
|
136
133
|
title: "More to come...",
|
|
137
|
-
description:
|
|
134
|
+
description: j ? /* @__PURE__ */ h(N, { children: [
|
|
138
135
|
"Stay tuned for more questions ",
|
|
139
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ n("br", {}),
|
|
140
137
|
" and insights."
|
|
141
|
-
] }) : /* @__PURE__ */
|
|
138
|
+
] }) : /* @__PURE__ */ h(N, { children: [
|
|
142
139
|
"Watch for additional enhanced stream ",
|
|
143
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ n("br", {}),
|
|
144
141
|
" interactive experience."
|
|
145
142
|
] })
|
|
146
143
|
}
|
|
147
|
-
) }) : /* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
) }) : /* @__PURE__ */ h(N, { children: [
|
|
145
|
+
l && /* @__PURE__ */ h(yt, { children: [
|
|
146
|
+
/* @__PURE__ */ n(vt, { name: "iconEarlyPrediction" }),
|
|
147
|
+
"EARLY PREDICTION"
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ n(pt, { style: dt ? { marginTop: 0 } : {}, id: "voteTitle", children: tt }),
|
|
150
|
+
l && /* @__PURE__ */ n(
|
|
151
|
+
X,
|
|
151
152
|
{
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
feedbackMessages: G,
|
|
154
|
+
questionVoted: !!t,
|
|
155
|
+
questionVotedCorrectly: t == null ? void 0 : t.correct,
|
|
156
|
+
questionType: r,
|
|
157
|
+
hasCorrectAnswer: s,
|
|
158
|
+
showExpiredNotification: u,
|
|
159
|
+
showClosedNotificationTrivia: P,
|
|
160
|
+
votedInCurrentRender: C,
|
|
161
|
+
votedAfterQuestionClosed: p,
|
|
162
|
+
enteredAnActiveQuestion: V,
|
|
163
|
+
marketClosed: T,
|
|
164
|
+
percentsAnimated: A,
|
|
165
|
+
voteErrorMessage: E,
|
|
166
|
+
isEarlyPrediction: l,
|
|
167
|
+
correctAnswer: i
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ h(Et, { children: [
|
|
171
|
+
/* @__PURE__ */ n(Q, { id: "voteOptions", children: D.map((o) => /* @__PURE__ */ n(
|
|
172
|
+
Rt,
|
|
173
|
+
{
|
|
174
|
+
...o,
|
|
175
|
+
markThatVoted: ct,
|
|
176
|
+
onPercentsAnimated: () => F(!0),
|
|
177
|
+
votedAfterQuestionClosed: p,
|
|
178
|
+
enteredAnActiveQuestion: V,
|
|
179
|
+
marketClosed: T
|
|
180
|
+
},
|
|
181
|
+
o.id
|
|
182
|
+
)) }),
|
|
183
|
+
l && /* @__PURE__ */ n(At, { children: /* @__PURE__ */ n(wt, { name: "mastersLogoWhite" }) })
|
|
184
|
+
] })
|
|
161
185
|
] })
|
|
162
186
|
] }) }) });
|
|
163
187
|
};
|
|
164
188
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
189
|
+
Bt as Vote,
|
|
190
|
+
Yt as VoteSkeleton
|
|
167
191
|
};
|
|
@@ -2,5 +2,10 @@ export declare const Container: import('@linaria/react').StyledComponent<import(
|
|
|
2
2
|
export declare const QuestionScrollContainer: any;
|
|
3
3
|
export declare const Content: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
4
|
export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const OptionsWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
6
|
export declare const Options: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
7
|
export declare const AlertContainer: any;
|
|
8
|
+
export declare const EarlyPrediction: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
+
export declare const EarlyPredictionIcon: any;
|
|
10
|
+
export declare const SponsorIcon: any;
|
|
11
|
+
export declare const SponsorLogo: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,36 +1,62 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
import { SDKScrollContainer as
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { SDKScrollContainer as n } from "../../../app/app/styles.js";
|
|
3
|
+
import { SvgIcon as o } from "../../icons/index.js";
|
|
4
|
+
import { ShowIn as t } from "../../show-in/index.js";
|
|
5
|
+
const I = /* @__PURE__ */ s("div")({
|
|
5
6
|
name: "Container",
|
|
6
7
|
class: "c14ielyq",
|
|
7
8
|
propsAsIs: !1
|
|
8
|
-
}),
|
|
9
|
+
}), r = () => n, d = /* @__PURE__ */ s(r())({
|
|
9
10
|
name: "QuestionScrollContainer",
|
|
10
11
|
class: "q1tlqx57",
|
|
11
12
|
propsAsIs: !0
|
|
12
|
-
}),
|
|
13
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
13
14
|
name: "Content",
|
|
14
15
|
class: "c1hq58md",
|
|
15
16
|
propsAsIs: !1
|
|
16
|
-
}),
|
|
17
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
17
18
|
name: "Title",
|
|
18
19
|
class: "t1c8nxcx",
|
|
19
20
|
propsAsIs: !1
|
|
21
|
+
}), S = /* @__PURE__ */ s("div")({
|
|
22
|
+
name: "OptionsWrap",
|
|
23
|
+
class: "oiozuc3",
|
|
24
|
+
propsAsIs: !1
|
|
20
25
|
}), C = /* @__PURE__ */ s("div")({
|
|
21
26
|
name: "Options",
|
|
22
|
-
class: "
|
|
27
|
+
class: "opnc44r",
|
|
23
28
|
propsAsIs: !1
|
|
24
|
-
}), e = () =>
|
|
29
|
+
}), e = () => t, v = /* @__PURE__ */ s(e())({
|
|
25
30
|
name: "AlertContainer",
|
|
26
|
-
class: "
|
|
31
|
+
class: "aq7p3w0",
|
|
27
32
|
propsAsIs: !0
|
|
33
|
+
}), x = /* @__PURE__ */ s("div")({
|
|
34
|
+
name: "EarlyPrediction",
|
|
35
|
+
class: "e1jlfj9g",
|
|
36
|
+
propsAsIs: !1
|
|
37
|
+
}), c = () => o, u = /* @__PURE__ */ s(c())({
|
|
38
|
+
name: "EarlyPredictionIcon",
|
|
39
|
+
class: "e84pmnd",
|
|
40
|
+
propsAsIs: !0
|
|
41
|
+
}), p = () => o, y = /* @__PURE__ */ s(p())({
|
|
42
|
+
name: "SponsorIcon",
|
|
43
|
+
class: "s1dybjw9",
|
|
44
|
+
propsAsIs: !0
|
|
45
|
+
}), q = /* @__PURE__ */ s("div")({
|
|
46
|
+
name: "SponsorLogo",
|
|
47
|
+
class: "s1l05ict",
|
|
48
|
+
propsAsIs: !1
|
|
28
49
|
});
|
|
29
50
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
v as AlertContainer,
|
|
52
|
+
I as Container,
|
|
53
|
+
A as Content,
|
|
54
|
+
x as EarlyPrediction,
|
|
55
|
+
u as EarlyPredictionIcon,
|
|
33
56
|
C as Options,
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
S as OptionsWrap,
|
|
58
|
+
d as QuestionScrollContainer,
|
|
59
|
+
y as SponsorIcon,
|
|
60
|
+
q as SponsorLogo,
|
|
61
|
+
f as Title
|
|
36
62
|
};
|