@streamlayer/react-ui 0.96.3 → 0.97.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 +50 -0
- package/lib/index-z0QjLiEL.js +75 -0
- package/lib/ui/app/Features/Gamification/Friends.d.ts +0 -2
- package/lib/ui/app/Features/Gamification/Friends.js +16 -22
- package/lib/ui/app/Features/Gamification/Leaderboard.js +31 -25
- package/lib/ui/app/Features/Gamification/Question.js +4 -2
- package/lib/ui/app/Features/Gamification/QuestionsList.js +11 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +30 -25
- package/lib/ui/app/Features/Gamification/UserSummary.js +14 -12
- package/lib/ui/app/Features/Gamification/gamification-feature.js +5 -1
- package/lib/ui/app/Features/Gamification/index.js +9 -5
- package/lib/ui/app/Features/index.js +24 -21
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -0
- package/lib/ui/app/Notifications/Onboarding/index.js +76 -78
- package/lib/ui/app/Notifications/index.js +98 -91
- package/lib/ui/app/Points/index.js +20 -17
- package/lib/ui/app/masters.js +76 -65
- package/lib/ui/app/useMastersApp.js +9 -9
- package/lib/ui/app/useSdkFeature.js +13 -16
- package/lib/ui/app/useSdkResponsive.js +1 -1
- package/lib/ui/app/useSdkScroll.d.ts +1 -1
- package/lib/ui/app/useSdkScroll.js +28 -25
- package/lib/ui/gamification/invite-link/index.js +26 -12
- package/lib/ui/gamification/onboarding/index.d.ts +0 -2
- package/lib/ui/gamification/onboarding/index.js +46 -46
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +2 -2
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -20
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +20 -15
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +34 -29
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +17 -32
- package/lib/ui/gamification/points/index.d.ts +1 -0
- package/lib/ui/gamification/points/index.js +9 -9
- package/lib/ui/gamification/question/index.d.ts +1 -0
- package/lib/ui/gamification/question/index.js +31 -24
- package/lib/ui/gamification/question/insight/index.js +3 -2
- package/lib/ui/gamification/question/list/index.d.ts +3 -1
- package/lib/ui/gamification/question/list/index.js +22 -19
- package/lib/ui/gamification/question/notification/index.js +3 -2
- package/lib/ui/gamification/question/notification/insight/index.js +10 -9
- package/lib/ui/gamification/question/notification/tweet/index.js +3 -2
- package/lib/ui/gamification/question/styles.d.ts +2 -0
- package/lib/ui/gamification/question/styles.js +39 -28
- package/lib/ui/gamification/question/twitter/index.js +3 -2
- package/lib/ui/gamification/user-statistics/index.d.ts +3 -2
- package/lib/ui/gamification/user-statistics/index.js +48 -45
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -2
- package/lib/ui/gamification/vote/feedback/index.js +76 -63
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +31 -24
- package/lib/ui/gamification/vote/index.js +93 -89
- package/lib/ui/gamification/vote/insight-details/index.js +7 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +3 -2
- package/lib/ui/gamification/vote/vote-option/index.d.ts +2 -1
- package/lib/ui/gamification/vote/vote-option/index.js +47 -39
- package/lib/ui/icons/index.d.ts +1 -2
- package/lib/ui/icons/index.js +44 -36
- package/lib/ui/modal/index.js +27 -21
- package/lib/ui/questions/insight/index.js +3 -2
- package/lib/ui/questions/twitter/index.js +3 -2
- package/lib/ui/show-in/index.d.ts +2 -0
- package/lib/ui/show-in/index.js +24 -14
- package/lib/ui/timer/index.js +32 -28
- package/lib/ui/video-player/index.js +41 -39
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +10 -9
- package/package.json +22 -21
- package/lib/index-keh7OLCY.js +0 -67
|
@@ -2,6 +2,7 @@ import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { TwitterContent as e } from "../../../../questions/twitter/index.js";
|
|
3
3
|
import { Container as m, QuoteWrap as n, Quote as p, ActionBtn as l } from "./styles.js";
|
|
4
4
|
import "../../../../video-player/index.js";
|
|
5
|
+
import "@linaria/core";
|
|
5
6
|
import "react";
|
|
6
7
|
import "../../../../icons/index.js";
|
|
7
8
|
import "@linaria/react";
|
|
@@ -10,11 +11,11 @@ import "../../../../questions/twitter/account/index.js";
|
|
|
10
11
|
import "../../../../../utils/common.js";
|
|
11
12
|
import "../../../../questions/twitter/account/styles.js";
|
|
12
13
|
import "../../../../questions/twitter/styles.js";
|
|
13
|
-
const
|
|
14
|
+
const g = ({ action: r, ...i }) => /* @__PURE__ */ o(m, { children: [
|
|
14
15
|
i.title && /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(p, { children: i.title }) }),
|
|
15
16
|
/* @__PURE__ */ t(e, { ...i }),
|
|
16
17
|
r && /* @__PURE__ */ t(l, { onClick: r, children: "View Insight" })
|
|
17
18
|
] });
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
g as Tweet
|
|
20
21
|
};
|
|
@@ -13,3 +13,5 @@ export declare const QuestionStatusIcon: import("@linaria/react").StyledComponen
|
|
|
13
13
|
export declare const QuestionTypeTitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
14
14
|
export declare const ExpiredQuestion: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
15
15
|
export declare const PlayButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
16
|
+
export declare const SkeletonContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
17
|
+
export declare const SkeletonButton: any;
|
|
@@ -1,77 +1,88 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SvgIcon as o } from "../../icons/index.js";
|
|
3
|
+
import { Container as n } from "../../skeleton/styles.js";
|
|
3
4
|
import "react/jsx-runtime";
|
|
4
5
|
import "react";
|
|
5
|
-
const
|
|
6
|
+
const r = /* @__PURE__ */ s("div")({
|
|
6
7
|
name: "QuestionItem",
|
|
7
8
|
class: "q1w97g3p",
|
|
8
9
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
10
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
10
11
|
name: "QuestionCaption",
|
|
11
12
|
class: "q2sl39u",
|
|
12
13
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
14
|
+
}), Q = /* @__PURE__ */ s("div")({
|
|
14
15
|
name: "QuestionBody",
|
|
15
16
|
class: "qd5h0uc",
|
|
16
17
|
propsAsIs: !1
|
|
17
|
-
}),
|
|
18
|
+
}), I = /* @__PURE__ */ s("div")({
|
|
18
19
|
name: "QuestionAction",
|
|
19
20
|
class: "q105uluy",
|
|
20
21
|
propsAsIs: !1
|
|
21
|
-
}), t = () => o,
|
|
22
|
+
}), t = () => o, A = /* @__PURE__ */ s(t())({
|
|
22
23
|
name: "QuestionActionIcon",
|
|
23
24
|
class: "q1fa0b9h",
|
|
24
25
|
propsAsIs: !0
|
|
25
|
-
}),
|
|
26
|
+
}), e = () => o, f = /* @__PURE__ */ s(e())({
|
|
26
27
|
name: "QuestionTypeIcon",
|
|
27
28
|
class: "qxlt78s",
|
|
28
29
|
propsAsIs: !0
|
|
29
|
-
}),
|
|
30
|
+
}), d = /* @__PURE__ */ s("div")({
|
|
30
31
|
name: "QuestionTypeLabel",
|
|
31
32
|
class: "qmg0vkx",
|
|
32
33
|
propsAsIs: !1
|
|
33
|
-
}),
|
|
34
|
+
}), y = /* @__PURE__ */ s("div")({
|
|
34
35
|
name: "QuestionContent",
|
|
35
36
|
class: "q1uz5j1g",
|
|
36
37
|
propsAsIs: !1
|
|
37
|
-
}),
|
|
38
|
+
}), q = /* @__PURE__ */ s("div")({
|
|
38
39
|
name: "QuestionSubject",
|
|
39
40
|
class: "qc3icwa",
|
|
40
41
|
propsAsIs: !1
|
|
41
|
-
}),
|
|
42
|
+
}), v = /* @__PURE__ */ s("button")({
|
|
42
43
|
name: "QuestionActionTitle",
|
|
43
44
|
class: "qmx43d1",
|
|
44
45
|
propsAsIs: !1
|
|
45
|
-
}),
|
|
46
|
+
}), T = /* @__PURE__ */ s("img")({
|
|
46
47
|
name: "QuestionStatusIcon",
|
|
47
48
|
class: "q1uc7n5z",
|
|
48
49
|
propsAsIs: !1
|
|
49
|
-
}),
|
|
50
|
+
}), x = /* @__PURE__ */ s("span")({
|
|
50
51
|
name: "QuestionTypeTitle",
|
|
51
52
|
class: "qcpp4y6",
|
|
52
53
|
propsAsIs: !1
|
|
53
|
-
}),
|
|
54
|
+
}), S = /* @__PURE__ */ s("span")({
|
|
54
55
|
name: "ExpiredQuestion",
|
|
55
56
|
class: "e1rdw3wd",
|
|
56
57
|
propsAsIs: !1
|
|
57
|
-
}),
|
|
58
|
+
}), b = /* @__PURE__ */ s("button")({
|
|
58
59
|
name: "PlayButton",
|
|
59
60
|
class: "p1pba9p1",
|
|
60
61
|
propsAsIs: !1
|
|
62
|
+
}), C = /* @__PURE__ */ s("div")({
|
|
63
|
+
name: "SkeletonContainer",
|
|
64
|
+
class: "s169lohr",
|
|
65
|
+
propsAsIs: !1
|
|
66
|
+
}), a = () => n, B = /* @__PURE__ */ s(a())({
|
|
67
|
+
name: "SkeletonButton",
|
|
68
|
+
class: "s1f43z3r",
|
|
69
|
+
propsAsIs: !0
|
|
61
70
|
});
|
|
62
71
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
S as ExpiredQuestion,
|
|
73
|
+
b as PlayButton,
|
|
74
|
+
I as QuestionAction,
|
|
75
|
+
A as QuestionActionIcon,
|
|
76
|
+
v as QuestionActionTitle,
|
|
77
|
+
Q as QuestionBody,
|
|
78
|
+
m as QuestionCaption,
|
|
79
|
+
y as QuestionContent,
|
|
80
|
+
r as QuestionItem,
|
|
81
|
+
T as QuestionStatusIcon,
|
|
82
|
+
q as QuestionSubject,
|
|
83
|
+
f as QuestionTypeIcon,
|
|
84
|
+
d as QuestionTypeLabel,
|
|
85
|
+
x as QuestionTypeTitle,
|
|
86
|
+
B as SkeletonButton,
|
|
87
|
+
C as SkeletonContainer
|
|
77
88
|
};
|
|
@@ -2,6 +2,7 @@ import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { TwitterContent as m } from "../../../questions/twitter/index.js";
|
|
3
3
|
import { Container as e, Quote as n, ActionButton as p } from "./styles.js";
|
|
4
4
|
import "../../../video-player/index.js";
|
|
5
|
+
import "@linaria/core";
|
|
5
6
|
import "react";
|
|
6
7
|
import "../../../icons/index.js";
|
|
7
8
|
import "@linaria/react";
|
|
@@ -12,11 +13,11 @@ import "../../../questions/twitter/account/styles.js";
|
|
|
12
13
|
import "../../../questions/twitter/styles.js";
|
|
13
14
|
import "../../../button/index.js";
|
|
14
15
|
import "../../../button/styles.js";
|
|
15
|
-
const
|
|
16
|
+
const A = ({ openTweet: r, ...t }) => /* @__PURE__ */ o(e, { children: [
|
|
16
17
|
t.title && /* @__PURE__ */ i(n, { children: t.title }),
|
|
17
18
|
/* @__PURE__ */ i(m, { ...t }),
|
|
18
19
|
r && /* @__PURE__ */ i(p, { onClick: () => r(t.tweetId), children: "View Insight" })
|
|
19
20
|
] });
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
A as Twitter
|
|
22
23
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface UserStatisticsProps {
|
|
3
|
+
loading?: boolean;
|
|
3
4
|
avatar?: string;
|
|
4
5
|
name?: string;
|
|
5
6
|
points?: number;
|
|
6
|
-
friendsRank
|
|
7
|
-
rank
|
|
7
|
+
friendsRank?: number;
|
|
8
|
+
rank?: number;
|
|
8
9
|
streak?: number;
|
|
9
10
|
correct?: number;
|
|
10
11
|
incorrect?: number;
|
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton as e } from "../../skeleton/index.js";
|
|
3
|
+
import { abbreviate as v, formatDecimals as L } from "../../../utils/common.js";
|
|
4
|
+
import { Rank as C } from "./components/rank/index.js";
|
|
5
|
+
import { Statistic as c } from "./components/statistic/index.js";
|
|
6
|
+
import { Container as w, TopInfo as V, User as g, UserAccountBtn as k, Avatar as I, AvatarPlaceholder as S, UserInfo as x, UserName as H, UserRating as R, Rts as U, TrophyIcon as b, RtsIndicator as u, RtsLabel as y, Divider as T, BottomInfo as M, Ranks as Z, Statistics as A } from "./styles.js";
|
|
7
|
+
import "../../skeleton/styles.js";
|
|
7
8
|
import "@linaria/react";
|
|
9
|
+
import "./components/rank/styles.js";
|
|
8
10
|
import "./components/statistic/styles.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
const B = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e", z = ({
|
|
12
|
+
loading: t,
|
|
13
|
+
avatar: n,
|
|
14
|
+
name: o,
|
|
15
|
+
points: l,
|
|
16
|
+
friendsRank: d,
|
|
17
|
+
rank: a,
|
|
18
|
+
streak: s,
|
|
19
|
+
correct: h,
|
|
20
|
+
incorrect: m,
|
|
21
|
+
inTop: p,
|
|
22
|
+
successRate: f
|
|
23
|
+
}) => /* @__PURE__ */ i(w, { "data-loading": t, children: [
|
|
24
|
+
/* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(e, { loading: t, children: /* @__PURE__ */ i(g, { children: [
|
|
25
|
+
/* @__PURE__ */ i(k, { children: [
|
|
26
|
+
n && /* @__PURE__ */ r(I, { alt: "avatar", src: n }),
|
|
27
|
+
!n && /* @__PURE__ */ r(S, { children: v(o || "") })
|
|
25
28
|
] }),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ i(x, { children: [
|
|
30
|
+
/* @__PURE__ */ r(H, { children: o }),
|
|
31
|
+
/* @__PURE__ */ i(R, { children: [
|
|
32
|
+
/* @__PURE__ */ i(U, { children: [
|
|
33
|
+
/* @__PURE__ */ r(b, { alt: "rank-icon", src: B }),
|
|
34
|
+
/* @__PURE__ */ i(u, { children: [
|
|
35
|
+
L(l),
|
|
36
|
+
/* @__PURE__ */ r(y, { children: "PTS" })
|
|
34
37
|
] })
|
|
35
38
|
] }),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ r(T, {}),
|
|
40
|
+
/* @__PURE__ */ i("div", { children: [
|
|
38
41
|
"TOP ",
|
|
39
|
-
|
|
42
|
+
p || 0,
|
|
40
43
|
"%"
|
|
41
44
|
] })
|
|
42
45
|
] })
|
|
43
46
|
] })
|
|
44
|
-
] }) }),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
47
|
+
] }) }) }),
|
|
48
|
+
/* @__PURE__ */ i(M, { children: [
|
|
49
|
+
/* @__PURE__ */ i(Z, { children: [
|
|
50
|
+
/* @__PURE__ */ r(e, { loading: t, style: { width: "100%" }, children: /* @__PURE__ */ r(C, { indicator: d || 0, title: "Friends rank" }) }),
|
|
51
|
+
/* @__PURE__ */ r(e, { loading: t, style: { width: "100%" }, children: /* @__PURE__ */ r(C, { indicator: a || 0, title: "Global rank" }) })
|
|
49
52
|
] }),
|
|
50
|
-
/* @__PURE__ */ r(
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
] })
|
|
53
|
+
/* @__PURE__ */ r(e, { loading: t, children: /* @__PURE__ */ i(A, { children: [
|
|
54
|
+
/* @__PURE__ */ r(c, { indicator: s || 0, title: "Win streak" }),
|
|
55
|
+
/* @__PURE__ */ r(c, { indicator: h || 0, title: "Correct" }),
|
|
56
|
+
/* @__PURE__ */ r(c, { indicator: m || 0, title: "Incorrect" }),
|
|
57
|
+
/* @__PURE__ */ r(c, { indicator: `${f || 0}%`, title: "Succ. rate" })
|
|
58
|
+
] }) })
|
|
56
59
|
] })
|
|
57
60
|
] });
|
|
58
61
|
export {
|
|
59
|
-
|
|
62
|
+
z as UserStatistics
|
|
60
63
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { QuestionType } from '@streamlayer/sdk-web-types';
|
|
3
3
|
interface FeedbackProps {
|
|
4
4
|
feedbackMessages?: Partial<Record<'correctFeedback' | 'incorrectFeedback', {
|
|
5
5
|
description: string;
|
|
@@ -9,13 +9,14 @@ interface FeedbackProps {
|
|
|
9
9
|
questionVoted?: boolean;
|
|
10
10
|
questionVotedCorrectly?: boolean;
|
|
11
11
|
hasCorrectAnswer: boolean;
|
|
12
|
-
questionStatus: QuestionStatus;
|
|
13
12
|
showExpiredNotification: boolean;
|
|
14
13
|
showClosedNotificationTrivia: boolean;
|
|
15
14
|
votedInCurrentRender: boolean;
|
|
16
15
|
votedAfterQuestionClosed: boolean;
|
|
17
16
|
enteredAnActiveQuestion: boolean;
|
|
17
|
+
voteErrorMessage: string;
|
|
18
18
|
marketClosed: boolean;
|
|
19
|
+
percentsAnimated?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const Feedback: React.FC<FeedbackProps>;
|
|
21
22
|
export {};
|
|
@@ -1,69 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as n, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C } from "react";
|
|
3
|
+
import { QuestionType as d } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { SvgIcon as a } from "../../../icons/index.js";
|
|
5
|
+
import { ShowInContainer as E, Container as K, IconPrediction as j, FeedbackDescription as l, FeedbackIconWrap as m, FeedbackHeader as F, FeedbackText as I, DynamicWrap as z, FeedbackTitle as G } from "./styles.js";
|
|
5
6
|
import "@linaria/react";
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
showExpiredNotification:
|
|
15
|
-
showClosedNotificationTrivia:
|
|
16
|
-
votedInCurrentRender:
|
|
17
|
-
votedAfterQuestionClosed:
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
import "../../../show-in/index.js";
|
|
8
|
+
import "@linaria/core";
|
|
9
|
+
const V = ({
|
|
10
|
+
feedbackMessages: r,
|
|
11
|
+
questionVotedCorrectly: x,
|
|
12
|
+
questionVoted: p,
|
|
13
|
+
questionType: e,
|
|
14
|
+
hasCorrectAnswer: u,
|
|
15
|
+
showExpiredNotification: w,
|
|
16
|
+
showClosedNotificationTrivia: P,
|
|
17
|
+
votedInCurrentRender: o,
|
|
18
|
+
votedAfterQuestionClosed: H,
|
|
19
|
+
voteErrorMessage: c,
|
|
20
|
+
enteredAnActiveQuestion: y,
|
|
21
|
+
marketClosed: L,
|
|
22
|
+
percentsAnimated: Y
|
|
20
23
|
}) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
24
|
+
var Q;
|
|
25
|
+
const f = p && (e === d.TRIVIA || e === d.PREDICTION), D = e === d.PREDICTION && !u, O = L && e === d.PREDICTION && !p && !y || e === d.PREDICTION && H && o && y, R = f && D, T = f && u, N = e === d.PREDICTION && p && o && u, S = p && e === d.POLL && o, b = x ? "correct" : "incorrect", h = x ? r == null ? void 0 : r.correctFeedback : r == null ? void 0 : r.incorrectFeedback, s = w || P || R || T || O || S || N || c, W = C(null), B = (Q = W.current) == null ? void 0 : Q.getBoundingClientRect().height, k = o && !Y;
|
|
26
|
+
return s ? /* @__PURE__ */ i(
|
|
27
|
+
E,
|
|
28
|
+
{
|
|
29
|
+
enabled: o && !k,
|
|
30
|
+
replayKey: k,
|
|
31
|
+
style: o ? { height: k ? 0 : B } : {},
|
|
32
|
+
children: /* @__PURE__ */ n(K, { ref: W, "data-prediction": D, children: [
|
|
33
|
+
c && /* @__PURE__ */ n(t, { children: [
|
|
34
|
+
/* @__PURE__ */ i(j, { name: "questionExpired" }),
|
|
35
|
+
/* @__PURE__ */ i(l, { children: c })
|
|
36
|
+
] }),
|
|
37
|
+
!c && w && /* @__PURE__ */ n(t, { children: [
|
|
38
|
+
/* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(a, { name: "questionExpired" }) }),
|
|
39
|
+
/* @__PURE__ */ n("div", { children: [
|
|
40
|
+
/* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Expired" }) }),
|
|
41
|
+
/* @__PURE__ */ i(I, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
42
|
+
] })
|
|
43
|
+
] }),
|
|
44
|
+
!c && P && /* @__PURE__ */ n(t, { children: [
|
|
45
|
+
/* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(a, { name: "questionExpired" }) }),
|
|
46
|
+
/* @__PURE__ */ n("div", { children: [
|
|
47
|
+
/* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Closed" }) }),
|
|
48
|
+
/* @__PURE__ */ i(I, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
|
|
49
|
+
] })
|
|
50
|
+
] }),
|
|
51
|
+
!c && O && /* @__PURE__ */ n(t, { children: [
|
|
52
|
+
/* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(a, { name: "questionExpired" }) }),
|
|
53
|
+
/* @__PURE__ */ n("div", { children: [
|
|
54
|
+
/* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Closed" }) }),
|
|
55
|
+
/* @__PURE__ */ i(I, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
|
|
56
|
+
] })
|
|
57
|
+
] }),
|
|
58
|
+
!c && R && /* @__PURE__ */ n(t, { children: [
|
|
59
|
+
/* @__PURE__ */ i(j, { name: "icon-prediction" }),
|
|
60
|
+
/* @__PURE__ */ n(l, { children: [
|
|
61
|
+
"Your pick has been recorded. ",
|
|
62
|
+
/* @__PURE__ */ i(z, { children: "We’ll notify you of the result." })
|
|
63
|
+
] })
|
|
64
|
+
] }),
|
|
65
|
+
!c && S && /* @__PURE__ */ n(t, { children: [
|
|
66
|
+
/* @__PURE__ */ i(m, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(a, { name: "correct" }) }),
|
|
67
|
+
/* @__PURE__ */ i(l, { children: "Thanks for answering. Please stay tuned for the next question." })
|
|
68
|
+
] }),
|
|
69
|
+
!c && (T || N) && !P && /* @__PURE__ */ n(t, { children: [
|
|
70
|
+
/* @__PURE__ */ i(m, { "data-feedback-type": b, children: /* @__PURE__ */ i(a, { name: b }) }),
|
|
71
|
+
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ n(F, { children: [
|
|
72
|
+
/* @__PURE__ */ i(G, { "data-feedback-type": b, children: h == null ? void 0 : h.title }),
|
|
73
|
+
/* @__PURE__ */ i(l, { children: h == null ? void 0 : h.description })
|
|
74
|
+
] }) })
|
|
75
|
+
] })
|
|
31
76
|
] })
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
35
|
-
/* @__PURE__ */ r("div", { children: [
|
|
36
|
-
/* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(d, { children: "Question Closed" }) }),
|
|
37
|
-
/* @__PURE__ */ i(s, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
|
|
38
|
-
] })
|
|
39
|
-
] }),
|
|
40
|
-
x && /* @__PURE__ */ r(t, { children: [
|
|
41
|
-
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
42
|
-
/* @__PURE__ */ r("div", { children: [
|
|
43
|
-
/* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(d, { children: "Question Closed" }) }),
|
|
44
|
-
/* @__PURE__ */ i(s, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
|
|
45
|
-
] })
|
|
46
|
-
] }),
|
|
47
|
-
D && /* @__PURE__ */ r(t, { children: [
|
|
48
|
-
/* @__PURE__ */ i(W, { name: "icon-prediction" }),
|
|
49
|
-
/* @__PURE__ */ r(d, { children: [
|
|
50
|
-
"Your pick has been recorded. ",
|
|
51
|
-
/* @__PURE__ */ i(L, { children: "We’ll notify you of the result." })
|
|
52
|
-
] })
|
|
53
|
-
] }),
|
|
54
|
-
R && /* @__PURE__ */ r(t, { children: [
|
|
55
|
-
/* @__PURE__ */ i(h, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(l, { name: "correct" }) }),
|
|
56
|
-
/* @__PURE__ */ i(d, { children: "Thanks for answering. Please stay tuned for the next question." })
|
|
57
|
-
] }),
|
|
58
|
-
(O || y) && /* @__PURE__ */ r(t, { children: [
|
|
59
|
-
/* @__PURE__ */ i(h, { "data-feedback-type": P, children: /* @__PURE__ */ i(l, { name: P }) }),
|
|
60
|
-
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ r(p, { children: [
|
|
61
|
-
/* @__PURE__ */ i(j, { "data-feedback-type": P, children: o == null ? void 0 : o.title }),
|
|
62
|
-
/* @__PURE__ */ i(d, { children: o == null ? void 0 : o.description })
|
|
63
|
-
] }) })
|
|
64
|
-
] })
|
|
65
|
-
] });
|
|
77
|
+
}
|
|
78
|
+
) : null;
|
|
66
79
|
};
|
|
67
80
|
export {
|
|
68
|
-
|
|
81
|
+
V as Feedback
|
|
69
82
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const ShowInContainer: any;
|
|
2
3
|
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const IconPrediction: any;
|
|
4
5
|
export declare const FeedbackIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,47 +1,54 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SvgIcon as e } from "../../../icons/index.js";
|
|
3
|
+
import { ShowIn as a } from "../../../show-in/index.js";
|
|
3
4
|
import "react/jsx-runtime";
|
|
4
5
|
import "react";
|
|
5
|
-
|
|
6
|
+
import "@linaria/core";
|
|
7
|
+
const o = () => a, m = /* @__PURE__ */ s(o())({
|
|
8
|
+
name: "ShowInContainer",
|
|
9
|
+
class: "s16sbdnm",
|
|
10
|
+
propsAsIs: !0
|
|
11
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
6
12
|
name: "Container",
|
|
7
|
-
class: "
|
|
13
|
+
class: "cbhorgl",
|
|
8
14
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
15
|
+
}), n = () => e, I = /* @__PURE__ */ s(n())({
|
|
10
16
|
name: "IconPrediction",
|
|
11
|
-
class: "
|
|
17
|
+
class: "i1g20ja7",
|
|
12
18
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
19
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
14
20
|
name: "FeedbackIconWrap",
|
|
15
|
-
class: "
|
|
21
|
+
class: "f455ozj",
|
|
16
22
|
propsAsIs: !1
|
|
17
|
-
}),
|
|
23
|
+
}), b = /* @__PURE__ */ s("div")({
|
|
18
24
|
name: "FeedbackHeader",
|
|
19
|
-
class: "
|
|
25
|
+
class: "f1913njx",
|
|
20
26
|
propsAsIs: !1
|
|
21
|
-
}),
|
|
27
|
+
}), k = /* @__PURE__ */ s("span")({
|
|
22
28
|
name: "FeedbackTitle",
|
|
23
|
-
class: "
|
|
29
|
+
class: "fzfk69z",
|
|
24
30
|
propsAsIs: !1
|
|
25
|
-
}),
|
|
31
|
+
}), F = /* @__PURE__ */ s("span")({
|
|
26
32
|
name: "FeedbackDescription",
|
|
27
|
-
class: "
|
|
33
|
+
class: "fx87qaj",
|
|
28
34
|
propsAsIs: !1
|
|
29
|
-
}),
|
|
35
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
30
36
|
name: "FeedbackText",
|
|
31
|
-
class: "
|
|
37
|
+
class: "fvek9ew",
|
|
32
38
|
propsAsIs: !1
|
|
33
|
-
}),
|
|
39
|
+
}), x = /* @__PURE__ */ s("span")({
|
|
34
40
|
name: "DynamicWrap",
|
|
35
|
-
class: "
|
|
41
|
+
class: "d1kbtp09",
|
|
36
42
|
propsAsIs: !1
|
|
37
43
|
});
|
|
38
44
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
l as Container,
|
|
46
|
+
x as DynamicWrap,
|
|
47
|
+
F as FeedbackDescription,
|
|
48
|
+
b as FeedbackHeader,
|
|
49
|
+
f as FeedbackIconWrap,
|
|
50
|
+
A as FeedbackText,
|
|
51
|
+
k as FeedbackTitle,
|
|
52
|
+
I as IconPrediction,
|
|
53
|
+
m as ShowInContainer
|
|
47
54
|
};
|