@streamlayer/react-ui 0.75.1 → 0.76.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/ui/app/Features/Gamification/Question.js +41 -32
- package/lib/ui/app/Features/Gamification/QuestionsList.js +10 -2
- package/lib/ui/app/Features/Gamification/Tabs.js +15 -7
- package/lib/ui/app/Features/Gamification/gamification-feature.js +10 -0
- package/lib/ui/app/Features/Gamification/index.js +12 -2
- package/lib/ui/app/Notifications/index.js +4 -2
- package/lib/ui/app/masters.js +4 -2
- package/lib/ui/gamification/question/list/index.js +22 -10
- package/lib/ui/gamification/question/notification/index.js +13 -11
- package/lib/ui/gamification/question/notification/tweet/index.d.ts +1 -1
- package/lib/ui/gamification/question/notification/tweet/index.js +10 -18
- package/lib/ui/gamification/question/notification/tweet/styles.d.ts +0 -3
- package/lib/ui/gamification/question/notification/tweet/styles.js +10 -25
- package/lib/ui/gamification/question/twitter/index.d.ts +4 -2
- package/lib/ui/gamification/question/twitter/index.js +33 -9
- package/lib/ui/gamification/question/twitter/styles.d.ts +2 -0
- package/lib/ui/gamification/question/twitter/styles.js +16 -6
- package/lib/ui/gamification/vote/feedback/index.d.ts +4 -1
- package/lib/ui/gamification/vote/feedback/index.js +50 -29
- package/lib/ui/gamification/vote/index.js +86 -69
- package/lib/ui/gamification/vote/insight-details/styles.js +2 -2
- package/lib/ui/gamification/vote/twitter-details/index.d.ts +1 -1
- package/lib/ui/gamification/vote/twitter-details/index.js +28 -6
- package/lib/ui/gamification/vote/twitter-details/styles.d.ts +2 -0
- package/lib/ui/gamification/vote/twitter-details/styles.js +12 -2
- package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -0
- package/lib/ui/gamification/vote/vote-option/index.js +50 -45
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +14 -13
- package/lib/ui/questions/insight/styles.js +8 -8
- package/lib/ui/questions/twitter/account/index.js +15 -9
- package/lib/ui/questions/twitter/account/styles.d.ts +1 -0
- package/lib/ui/questions/twitter/account/styles.js +21 -13
- package/lib/ui/questions/twitter/index.d.ts +3 -6
- package/lib/ui/questions/twitter/index.js +8 -13
- package/lib/ui/questions/twitter/styles.d.ts +0 -3
- package/lib/ui/questions/twitter/styles.js +8 -23
- package/package.json +8 -8
package/lib/ui/app/masters.js
CHANGED
|
@@ -30,8 +30,10 @@ import "../video-player/styles.js";
|
|
|
30
30
|
import "../gamification/question/notification/insight/styles.js";
|
|
31
31
|
import "../gamification/question/notification/styles.js";
|
|
32
32
|
import "../gamification/question/notification/tweet/index.js";
|
|
33
|
+
import "../questions/twitter/index.js";
|
|
33
34
|
import "../questions/twitter/account/index.js";
|
|
34
35
|
import "../questions/twitter/account/styles.js";
|
|
36
|
+
import "../questions/twitter/styles.js";
|
|
35
37
|
import "../gamification/question/notification/tweet/styles.js";
|
|
36
38
|
import "../gamification/question/notification/prediction-result/index.js";
|
|
37
39
|
import "../gamification/question/notification/prediction-result/animation-lines/index.js";
|
|
@@ -60,7 +62,7 @@ import "../navigation/button/index.js";
|
|
|
60
62
|
const F = ({ sdk: r, className: i }) => {
|
|
61
63
|
const [, m] = I(r);
|
|
62
64
|
return /* @__PURE__ */ t(g, { className: i, feature: m, sdk: r });
|
|
63
|
-
},
|
|
65
|
+
}, Lt = ({ sdk: r, overlays: i, children: m }) => {
|
|
64
66
|
const { sdkEnabled: p, sdkReady: e, activeOverlay: o, activateAndLoadOverlay: d, activateEventWithId: c, deactivate: l, isLogged: f } = C(r);
|
|
65
67
|
return y(() => {
|
|
66
68
|
import("./Features/Gamification/gamification-feature.js");
|
|
@@ -96,5 +98,5 @@ const F = ({ sdk: r, className: i }) => {
|
|
|
96
98
|
] });
|
|
97
99
|
};
|
|
98
100
|
export {
|
|
99
|
-
|
|
101
|
+
Lt as MastersApp
|
|
100
102
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Question as
|
|
3
|
-
import { Insight as
|
|
4
|
-
import {
|
|
2
|
+
import { Question as b } from "../index.js";
|
|
3
|
+
import { Insight as c } from "../insight/index.js";
|
|
4
|
+
import { Twitter as p } from "../twitter/index.js";
|
|
5
|
+
import { QuestionsContainer as d } from "./styles.js";
|
|
5
6
|
import "@streamlayer/sdk-web-types";
|
|
6
7
|
import "../../constants.js";
|
|
7
8
|
import "../styles.js";
|
|
@@ -14,18 +15,29 @@ import "../../../video-player/styles.js";
|
|
|
14
15
|
import "../../../../utils/common.js";
|
|
15
16
|
import "../../../questions/insight/styles.js";
|
|
16
17
|
import "../insight/styles.js";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
import "../../../questions/twitter/index.js";
|
|
19
|
+
import "../../../questions/twitter/account/index.js";
|
|
20
|
+
import "../../../questions/twitter/account/styles.js";
|
|
21
|
+
import "../../../questions/twitter/styles.js";
|
|
22
|
+
import "../twitter/styles.js";
|
|
23
|
+
import "../../../button/index.js";
|
|
24
|
+
import "../../../button/styles.js";
|
|
25
|
+
const J = ({ questions: r, openQuestion: m }) => /* @__PURE__ */ e(d, { children: r == null ? void 0 : r.map((t) => {
|
|
26
|
+
var o, u, a;
|
|
27
|
+
if (t.type === "question" && ((o = t.attributes) == null ? void 0 : o.attributes.case) === "question") {
|
|
20
28
|
const i = t.attributes.attributes.value;
|
|
21
|
-
return /* @__PURE__ */ e(
|
|
29
|
+
return /* @__PURE__ */ e(b, { openQuestion: m, ...i }, i.questionId);
|
|
22
30
|
}
|
|
23
|
-
if (t.type === "insight" && ((
|
|
31
|
+
if (t.type === "insight" && ((u = t.attributes) == null ? void 0 : u.attributes.case) === "insight") {
|
|
24
32
|
const i = t.attributes.attributes.value;
|
|
25
|
-
return /* @__PURE__ */ e(
|
|
33
|
+
return /* @__PURE__ */ e(c, { openInsight: m, ...i }, i.questionId);
|
|
34
|
+
}
|
|
35
|
+
if (t.type === "tweet" && ((a = t.attributes) == null ? void 0 : a.attributes.case) === "tweet") {
|
|
36
|
+
const i = t.attributes.attributes.value, n = t.attributes.id, s = t.attributes.created;
|
|
37
|
+
return /* @__PURE__ */ e(p, { openTweet: m, ...i, tweetId: n, created: s }, n);
|
|
26
38
|
}
|
|
27
39
|
return null;
|
|
28
40
|
}) });
|
|
29
41
|
export {
|
|
30
|
-
|
|
42
|
+
J as QuestionList
|
|
31
43
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
2
|
import { QuestionType as t } from "@streamlayer/sdk-web-types";
|
|
3
3
|
import { QuestionTypeData as d } from "../../constants.js";
|
|
4
4
|
import { Insight as f } from "./insight/index.js";
|
|
@@ -10,18 +10,20 @@ import "../../../icons/index.js";
|
|
|
10
10
|
import "@linaria/react";
|
|
11
11
|
import "../../../video-player/styles.js";
|
|
12
12
|
import "./insight/styles.js";
|
|
13
|
+
import "../../../questions/twitter/index.js";
|
|
13
14
|
import "../../../questions/twitter/account/index.js";
|
|
14
15
|
import "../../../questions/twitter/account/styles.js";
|
|
16
|
+
import "../../../questions/twitter/styles.js";
|
|
15
17
|
import "./tweet/styles.js";
|
|
16
|
-
const
|
|
17
|
-
close:
|
|
18
|
+
const y = ({
|
|
19
|
+
close: a,
|
|
18
20
|
action: i,
|
|
19
|
-
data: { questionType: r, question: m, insight:
|
|
21
|
+
data: { questionType: r, question: m, insight: e, tweet: l }
|
|
20
22
|
}) => {
|
|
21
23
|
const n = d[r];
|
|
22
|
-
return n ? /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ o(I, { onClick:
|
|
24
|
-
r !== t.TWEET && /* @__PURE__ */
|
|
24
|
+
return n ? /* @__PURE__ */ p(h, { children: [
|
|
25
|
+
/* @__PURE__ */ o(I, { onClick: a, children: /* @__PURE__ */ o(T, { name: "icon-cross" }) }),
|
|
26
|
+
r !== t.TWEET && /* @__PURE__ */ p(C, { children: [
|
|
25
27
|
/* @__PURE__ */ o(
|
|
26
28
|
E,
|
|
27
29
|
{
|
|
@@ -32,17 +34,17 @@ const R = ({
|
|
|
32
34
|
),
|
|
33
35
|
/* @__PURE__ */ o(s, { children: n.label })
|
|
34
36
|
] }),
|
|
35
|
-
r === t.FACTOID && /* @__PURE__ */ o(f, { ...
|
|
37
|
+
r === t.FACTOID && /* @__PURE__ */ o(f, { ...e, action: i }),
|
|
36
38
|
r === t.TWEET && // ToDo: connect with real Api data
|
|
37
39
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
38
40
|
// @ts-ignore
|
|
39
|
-
/* @__PURE__ */ o(W, { ...
|
|
40
|
-
r !== t.FACTOID && r !== t.TWEET && /* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ o(W, { ...l, action: i }),
|
|
42
|
+
r !== t.FACTOID && r !== t.TWEET && /* @__PURE__ */ p(c, { children: [
|
|
41
43
|
/* @__PURE__ */ o(A, { children: m == null ? void 0 : m.title }),
|
|
42
44
|
/* @__PURE__ */ o(D, { onClick: i, children: "Answer" })
|
|
43
45
|
] })
|
|
44
46
|
] }) : null;
|
|
45
47
|
};
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
y as Notification
|
|
48
50
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Notification } from '@streamlayer/sdk-web-notifications';
|
|
3
|
-
import { TwitterContentProps } from '../../../../questions/twitter';
|
|
3
|
+
import { type TwitterContentProps } from '../../../../questions/twitter';
|
|
4
4
|
export declare const Tweet: React.FC<TwitterContentProps & {
|
|
5
5
|
action: Notification['action'];
|
|
6
6
|
}>;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { Container as
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { TwitterContent as e } from "../../../../questions/twitter/index.js";
|
|
3
|
+
import { Container as n, QuoteWrap as m, Quote as l, ActionBtn as p } from "./styles.js";
|
|
4
|
+
import "../../../../questions/twitter/account/index.js";
|
|
4
5
|
import "../../../../icons/index.js";
|
|
5
6
|
import "@linaria/react";
|
|
6
7
|
import "react";
|
|
7
8
|
import "../../../../questions/twitter/account/styles.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
action: t
|
|
14
|
-
}) => /* @__PURE__ */ e(p, { children: [
|
|
15
|
-
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(d, { children: c }) }),
|
|
16
|
-
/* @__PURE__ */ e(h, { children: [
|
|
17
|
-
/* @__PURE__ */ r(m, { ...i }),
|
|
18
|
-
/* @__PURE__ */ r(s, { children: n }),
|
|
19
|
-
o && /* @__PURE__ */ r(u, { src: o })
|
|
20
|
-
] }),
|
|
21
|
-
t && /* @__PURE__ */ r(f, { onClick: t, children: "View Tweet" })
|
|
9
|
+
import "../../../../questions/twitter/styles.js";
|
|
10
|
+
const j = ({ action: r, ...i }) => /* @__PURE__ */ o(n, { children: [
|
|
11
|
+
i.title && /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(l, { children: i.title }) }),
|
|
12
|
+
/* @__PURE__ */ t(e, { ...i }),
|
|
13
|
+
r && /* @__PURE__ */ t(p, { onClick: r, children: "View Insight" })
|
|
22
14
|
] });
|
|
23
15
|
export {
|
|
24
|
-
|
|
16
|
+
j as Tweet
|
|
25
17
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
3
|
export declare const ActionBtn: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
4
|
-
export declare const Body: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
-
export declare const Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
6
|
-
export declare const Details: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
4
|
export declare const QuoteWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
8
5
|
export declare const Quote: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLQuoteElement> & import("react").BlockquoteHTMLAttributes<HTMLQuoteElement> & Record<never, unknown>>;
|
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const t = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "c1t4f0x4",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
6
|
+
}), n = /* @__PURE__ */ s("button")({
|
|
7
7
|
name: "ActionBtn",
|
|
8
8
|
class: "a16w1nl6",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
11
|
-
name: "Body",
|
|
12
|
-
class: "b14u54rf",
|
|
13
|
-
propsAsIs: !1
|
|
14
|
-
}), n = /* @__PURE__ */ s("img")({
|
|
15
|
-
name: "Image",
|
|
16
|
-
class: "i1hxm6zo",
|
|
17
|
-
propsAsIs: !1
|
|
18
|
-
}), l = /* @__PURE__ */ s("div")({
|
|
19
|
-
name: "Details",
|
|
20
|
-
class: "d1s19yop",
|
|
21
|
-
propsAsIs: !1
|
|
22
|
-
}), c = /* @__PURE__ */ s("div")({
|
|
10
|
+
}), e = /* @__PURE__ */ s("div")({
|
|
23
11
|
name: "QuoteWrap",
|
|
24
|
-
class: "
|
|
12
|
+
class: "q14u54rf",
|
|
25
13
|
propsAsIs: !1
|
|
26
|
-
}),
|
|
14
|
+
}), a = /* @__PURE__ */ s("blockquote")({
|
|
27
15
|
name: "Quote",
|
|
28
|
-
class: "
|
|
16
|
+
class: "q1hxm6zo",
|
|
29
17
|
propsAsIs: !1
|
|
30
18
|
});
|
|
31
19
|
export {
|
|
32
|
-
|
|
33
|
-
t as
|
|
34
|
-
a as
|
|
35
|
-
|
|
36
|
-
n as Image,
|
|
37
|
-
p as Quote,
|
|
38
|
-
c as QuoteWrap
|
|
20
|
+
n as ActionBtn,
|
|
21
|
+
t as Container,
|
|
22
|
+
a as Quote,
|
|
23
|
+
e as QuoteWrap
|
|
39
24
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TwitterContentProps } from '../../../questions/twitter';
|
|
3
|
-
export declare const Twitter: React.FC<TwitterContentProps
|
|
2
|
+
import { type TwitterContentProps } from '../../../questions/twitter';
|
|
3
|
+
export declare const Twitter: React.FC<TwitterContentProps & {
|
|
4
|
+
openTweet?: (questionId: string) => void;
|
|
5
|
+
}>;
|
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as a } from "react";
|
|
3
|
+
import { TwitterContent as l } from "../../../questions/twitter/index.js";
|
|
4
|
+
import { isValidDate as f, formatDate as d, formatTime as c } from "../../../../utils/common.js";
|
|
5
|
+
import { Container as u, DateTime as p, Quote as s, ActionButton as h } from "./styles.js";
|
|
4
6
|
import "../../../questions/twitter/account/index.js";
|
|
5
7
|
import "../../../icons/index.js";
|
|
6
8
|
import "@linaria/react";
|
|
7
|
-
import "react";
|
|
8
9
|
import "../../../questions/twitter/account/styles.js";
|
|
9
10
|
import "../../../questions/twitter/styles.js";
|
|
10
11
|
import "../../../button/index.js";
|
|
11
12
|
import "../../../button/styles.js";
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const M = ({
|
|
14
|
+
openTweet: m,
|
|
15
|
+
created: i,
|
|
16
|
+
...t
|
|
17
|
+
}) => {
|
|
18
|
+
const r = a(() => {
|
|
19
|
+
if (i) {
|
|
20
|
+
const e = new Date(i);
|
|
21
|
+
if (f(e))
|
|
22
|
+
return {
|
|
23
|
+
date: d(e),
|
|
24
|
+
time: c(e)
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}, [i]);
|
|
29
|
+
return /* @__PURE__ */ n(u, { children: [
|
|
30
|
+
r && /* @__PURE__ */ n(p, { children: [
|
|
31
|
+
r.date,
|
|
32
|
+
" · ",
|
|
33
|
+
r.time
|
|
34
|
+
] }),
|
|
35
|
+
t.title && /* @__PURE__ */ o(s, { children: t.title }),
|
|
36
|
+
/* @__PURE__ */ o(l, { ...t }),
|
|
37
|
+
m && /* @__PURE__ */ o(h, { onClick: () => m(t.tweetId), children: "View Insight" })
|
|
38
|
+
] });
|
|
39
|
+
};
|
|
16
40
|
export {
|
|
17
|
-
|
|
41
|
+
M as Twitter
|
|
18
42
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
3
|
export declare const ActionButton: any;
|
|
4
|
+
export declare const DateTime: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const Quote: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLQuoteElement> & import("react").BlockquoteHTMLAttributes<HTMLQuoteElement> & Record<never, unknown>>;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
import { Button as t } from "../../../button/index.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../button/styles.js";
|
|
5
|
-
const c = /* @__PURE__ */
|
|
5
|
+
const c = /* @__PURE__ */ s("div")({
|
|
6
6
|
name: "Container",
|
|
7
7
|
class: "cl56x6b",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), o = () => t, r = /* @__PURE__ */ s(o())({
|
|
10
10
|
name: "ActionButton",
|
|
11
11
|
class: "a11pzf92",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
14
|
+
name: "DateTime",
|
|
15
|
+
class: "d1hbaleq",
|
|
16
|
+
propsAsIs: !1
|
|
17
|
+
}), i = /* @__PURE__ */ s("blockquote")({
|
|
18
|
+
name: "Quote",
|
|
19
|
+
class: "qvvgqjm",
|
|
20
|
+
propsAsIs: !1
|
|
13
21
|
});
|
|
14
22
|
export {
|
|
15
|
-
|
|
16
|
-
c as Container
|
|
23
|
+
r as ActionButton,
|
|
24
|
+
c as Container,
|
|
25
|
+
m as DateTime,
|
|
26
|
+
i as Quote
|
|
17
27
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { QuestionStatus, QuestionType } from '@streamlayer/sdk-web-types';
|
|
3
3
|
interface FeedbackProps {
|
|
4
|
-
feedbackMessages
|
|
4
|
+
feedbackMessages?: Partial<Record<'correctFeedback' | 'incorrectFeedback', {
|
|
5
5
|
description: string;
|
|
6
6
|
title: string;
|
|
7
7
|
}>>;
|
|
@@ -10,6 +10,9 @@ interface FeedbackProps {
|
|
|
10
10
|
questionVotedCorrectly?: boolean;
|
|
11
11
|
hasCorrectAnswer: boolean;
|
|
12
12
|
questionStatus: QuestionStatus;
|
|
13
|
+
votedInCurrentRender: boolean;
|
|
14
|
+
votedAfterQuestionClosed: boolean;
|
|
15
|
+
enteredAnActiveQuestion: boolean;
|
|
13
16
|
}
|
|
14
17
|
export declare const Feedback: React.FC<FeedbackProps>;
|
|
15
18
|
export {};
|
|
@@ -1,42 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
import { Container as
|
|
1
|
+
import { jsxs as r, Fragment as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as o, QuestionStatus as I } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { SvgIcon as l } from "../../../icons/index.js";
|
|
4
|
+
import { Container as L, FeedbackIconWrap as h, FeedbackHeader as E, FeedbackDescription as t, FeedbackText as P, IconPrediction as y, FeedbackTitle as C } from "./styles.js";
|
|
5
5
|
import "@linaria/react";
|
|
6
6
|
import "react";
|
|
7
|
-
const
|
|
8
|
-
feedbackMessages:
|
|
9
|
-
questionVotedCorrectly:
|
|
10
|
-
questionVoted:
|
|
11
|
-
questionType:
|
|
12
|
-
hasCorrectAnswer:
|
|
13
|
-
questionStatus:
|
|
7
|
+
const Q = ({
|
|
8
|
+
feedbackMessages: n,
|
|
9
|
+
questionVotedCorrectly: s,
|
|
10
|
+
questionVoted: a,
|
|
11
|
+
questionType: c,
|
|
12
|
+
hasCorrectAnswer: x,
|
|
13
|
+
questionStatus: w,
|
|
14
|
+
votedInCurrentRender: m,
|
|
15
|
+
votedAfterQuestionClosed: T,
|
|
16
|
+
enteredAnActiveQuestion: p
|
|
14
17
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
18
|
+
const b = a && (c === o.TRIVIA || c === o.PREDICTION) && m && w !== I.RESOLVED, D = c === o.PREDICTION && !x, N = w === I.RESOLVED && c === o.TRIVIA && !a && !p, O = c === o.TRIVIA && T && m && p, R = w === I.RESOLVED && c === o.PREDICTION && !a && !p || c === o.PREDICTION && T && m && p, k = b && D, f = b && x, S = a && c === o.POLL && m;
|
|
19
|
+
if (!N && !O && !k && !f && !R && !S)
|
|
17
20
|
return null;
|
|
18
|
-
const F =
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
21
|
+
const F = s ? "correct" : "incorrect", d = s ? n == null ? void 0 : n.correctFeedback : n == null ? void 0 : n.incorrectFeedback;
|
|
22
|
+
return /* @__PURE__ */ r(L, { "data-isPrediction": D, children: [
|
|
23
|
+
N && /* @__PURE__ */ r(e, { children: [
|
|
24
|
+
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
25
|
+
/* @__PURE__ */ r("div", { children: [
|
|
26
|
+
/* @__PURE__ */ i(E, { children: /* @__PURE__ */ i(t, { children: "Question Expired" }) }),
|
|
27
|
+
/* @__PURE__ */ i(P, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
25
28
|
] })
|
|
26
29
|
] }),
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
O && /* @__PURE__ */ r(e, { children: [
|
|
31
|
+
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
32
|
+
/* @__PURE__ */ r("div", { children: [
|
|
33
|
+
/* @__PURE__ */ i(E, { children: /* @__PURE__ */ i(t, { children: "Question Closed" }) }),
|
|
34
|
+
/* @__PURE__ */ i(P, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
|
|
35
|
+
] })
|
|
36
|
+
] }),
|
|
37
|
+
R && /* @__PURE__ */ r(e, { children: [
|
|
38
|
+
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
39
|
+
/* @__PURE__ */ r("div", { children: [
|
|
40
|
+
/* @__PURE__ */ i(E, { children: /* @__PURE__ */ i(t, { children: "Question Closed" }) }),
|
|
41
|
+
/* @__PURE__ */ i(P, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
|
|
42
|
+
] })
|
|
43
|
+
] }),
|
|
44
|
+
k && /* @__PURE__ */ r(e, { children: [
|
|
45
|
+
/* @__PURE__ */ i(y, { name: "icon-prediction" }),
|
|
46
|
+
/* @__PURE__ */ i(t, { children: "Stay tuned to see if your prediction was correct." })
|
|
47
|
+
] }),
|
|
48
|
+
S && /* @__PURE__ */ r(e, { children: [
|
|
49
|
+
/* @__PURE__ */ i(h, { "data-feedbackType": "correct", children: /* @__PURE__ */ i(l, { name: "correct" }) }),
|
|
50
|
+
/* @__PURE__ */ i(t, { children: "That's for answering. Please stay tuned for the next question." })
|
|
30
51
|
] }),
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
52
|
+
f && /* @__PURE__ */ r(e, { children: [
|
|
53
|
+
/* @__PURE__ */ i(h, { "data-feedbackType": F, children: /* @__PURE__ */ i(l, { name: F }) }),
|
|
54
|
+
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ r(E, { children: [
|
|
55
|
+
/* @__PURE__ */ i(C, { "data-feedbackType": F, children: d == null ? void 0 : d.title }),
|
|
56
|
+
/* @__PURE__ */ i(t, { children: d == null ? void 0 : d.description })
|
|
36
57
|
] }) })
|
|
37
58
|
] })
|
|
38
59
|
] });
|
|
39
60
|
};
|
|
40
61
|
export {
|
|
41
|
-
|
|
62
|
+
Q as Feedback
|
|
42
63
|
};
|