@streamlayer/react-ui 0.65.0 → 0.65.2
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/ui/app/Features/Gamification/Leaderboard.js +2 -2
- package/lib/ui/app/Features/Gamification/UserSummary.js +7 -7
- package/lib/ui/app/Features/Gamification/index.js +17 -14
- package/lib/ui/gamification/user-statistics/index.d.ts +1 -1
- package/lib/ui/gamification/user-statistics/index.js +1 -1
- package/package.json +2 -2
|
@@ -15,14 +15,14 @@ import "../../../gamification/onboarding/slides/onboarding-invite-card/index.js"
|
|
|
15
15
|
import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
|
|
16
16
|
const j = ({ gamification: r }) => {
|
|
17
17
|
const { data: e } = t(r.leaderboardList.$store);
|
|
18
|
-
return e != null && e.length ? /* @__PURE__ */ o(
|
|
18
|
+
return e != null && e.length ? /* @__PURE__ */ o(
|
|
19
19
|
p,
|
|
20
20
|
{
|
|
21
21
|
fetchMore: r.leaderboardList.fetchMore,
|
|
22
22
|
items: e,
|
|
23
23
|
openItemDetail: r.openUser
|
|
24
24
|
}
|
|
25
|
-
);
|
|
25
|
+
) : /* @__PURE__ */ o(m, { deepLink: r.deepLink });
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
28
|
j as Leaderboard
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as i } from "@nanostores/react";
|
|
3
|
-
import { UserStatistics as
|
|
3
|
+
import { UserStatistics as s } from "../../../gamification/user-statistics/index.js";
|
|
4
4
|
import "../../../../utils/common.js";
|
|
5
5
|
import "../../../gamification/user-statistics/components/rank/index.js";
|
|
6
6
|
import "../../../gamification/user-statistics/components/rank/styles.js";
|
|
@@ -8,11 +8,11 @@ import "@linaria/react";
|
|
|
8
8
|
import "../../../gamification/user-statistics/components/statistic/index.js";
|
|
9
9
|
import "../../../gamification/user-statistics/components/statistic/styles.js";
|
|
10
10
|
import "../../../gamification/user-statistics/styles.js";
|
|
11
|
-
const
|
|
12
|
-
var t;
|
|
13
|
-
const r = i(
|
|
14
|
-
return (t = r.data) != null && t.summary ? /* @__PURE__ */
|
|
11
|
+
const x = ({ userSummary: e }) => {
|
|
12
|
+
var t, m;
|
|
13
|
+
const r = i(e.getStore());
|
|
14
|
+
return (t = r.data) != null && t.summary ? /* @__PURE__ */ o(s, { ...r.data.summary, successRate: (m = r.data.percentage) == null ? void 0 : m.correct }) : /* @__PURE__ */ o("div", { children: "wait user..." });
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
x as UserSummary
|
|
18
18
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
1
|
+
import { jsxs as e, Fragment as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { styled as s } from "@linaria/react";
|
|
3
3
|
import { useStore as m } from "@nanostores/react";
|
|
4
4
|
import { SDKWhiteContainer as l, SDKScrollContainer as a } from "../../styles.js";
|
|
5
5
|
import { VoteHeader as c } from "../../../gamification/detail/header/index.js";
|
|
6
|
-
import { UserStatistics as
|
|
7
|
-
import { ShowIn as
|
|
6
|
+
import { UserStatistics as u } from "../../../gamification/user-statistics/index.js";
|
|
7
|
+
import { ShowIn as h } from "../../../show-in/index.js";
|
|
8
8
|
import { Question as f } from "./Question.js";
|
|
9
9
|
import { Tabs as v } from "./Tabs.js";
|
|
10
10
|
import "../../../gamification/constants.js";
|
|
@@ -58,13 +58,13 @@ import "../../../gamification/question/insight/index.js";
|
|
|
58
58
|
import "../../../gamification/question/insight/styles.js";
|
|
59
59
|
import "../../../gamification/question/list/styles.js";
|
|
60
60
|
import "./UserSummary.js";
|
|
61
|
-
const
|
|
61
|
+
const n = s(h)`
|
|
62
62
|
position: absolute;
|
|
63
63
|
inset: 0;
|
|
64
64
|
top: var(--header-height);
|
|
65
65
|
background: var(--color-neutrals-white);
|
|
66
66
|
z-index: 3;
|
|
67
|
-
`, x =
|
|
67
|
+
`, x = s.div`
|
|
68
68
|
background: var(--color-transparent-item);
|
|
69
69
|
width: 100%;
|
|
70
70
|
height: 100%;
|
|
@@ -77,18 +77,21 @@ const e = n(u)`
|
|
|
77
77
|
& > div {
|
|
78
78
|
width: 100%;
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
`, S = ({ correct: t, incorrect: o }) => {
|
|
81
|
+
const i = t + o;
|
|
82
|
+
return i === 0 ? 0 : Math.round(t / i * 100);
|
|
83
|
+
}, kt = ({ gamification: t, className: o }) => {
|
|
84
|
+
const i = m(t.openedQuestion.$store), p = m(t.openedUser);
|
|
85
|
+
return /* @__PURE__ */ e(d, { children: [
|
|
86
|
+
i && /* @__PURE__ */ r(n, { className: o, children: /* @__PURE__ */ r(f, { gamification: t }) }),
|
|
87
|
+
p && /* @__PURE__ */ r(n, { className: o, children: /* @__PURE__ */ e(x, { children: [
|
|
85
88
|
/* @__PURE__ */ r(c, { label: "Friend's Rank", close: t.closeUser }),
|
|
86
|
-
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(
|
|
89
|
+
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(u, { ...p, successRate: S(p) }) })
|
|
87
90
|
] }) }),
|
|
88
91
|
/* @__PURE__ */ r(a, { className: o, "data-nav": "true", children: /* @__PURE__ */ r(v, { gamification: t }) })
|
|
89
92
|
] });
|
|
90
93
|
};
|
|
91
94
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
kt as GamificationOverlay,
|
|
96
|
+
kt as default
|
|
94
97
|
};
|
|
@@ -16,7 +16,7 @@ const m = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXd
|
|
|
16
16
|
correct: u,
|
|
17
17
|
incorrect: x,
|
|
18
18
|
inTop: i,
|
|
19
|
-
|
|
19
|
+
successRate: O
|
|
20
20
|
}) => /* @__PURE__ */ N(k, { children: [
|
|
21
21
|
/* @__PURE__ */ M(E, { children: /* @__PURE__ */ N(Q, { children: [
|
|
22
22
|
/* @__PURE__ */ N(Y, { children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -84,6 +84,6 @@
|
|
|
84
84
|
"vite-plugin-svgr": "^4.1.0",
|
|
85
85
|
"vite-svg-loader": "^4.0.0",
|
|
86
86
|
"vite-tsconfig-paths": "^4.2.1",
|
|
87
|
-
"@streamlayer/react": "^0.29.
|
|
87
|
+
"@streamlayer/react": "^0.29.9"
|
|
88
88
|
}
|
|
89
89
|
}
|