@streamlayer/react-ui 0.65.0 → 0.65.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.
@@ -1,6 +1,6 @@
1
- import { jsx as m } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import { useStore as i } from "@nanostores/react";
3
- import { UserStatistics as e } from "../../../gamification/user-statistics/index.js";
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 g = ({ userSummary: o }) => {
12
- var t;
13
- const r = i(o.getStore());
14
- return (t = r.data) != null && t.summary ? /* @__PURE__ */ m(e, { ...r.data.summary, ...r.data.percentage }) : /* @__PURE__ */ m("div", { children: "wait user..." });
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
- g as UserSummary
17
+ x as UserSummary
18
18
  };
@@ -1,10 +1,10 @@
1
- import { jsxs as p, Fragment as d, jsx as r } from "react/jsx-runtime";
2
- import { styled as n } from "@linaria/react";
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 h } from "../../../gamification/user-statistics/index.js";
7
- import { ShowIn as u } from "../../../show-in/index.js";
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 e = n(u)`
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 = n.div`
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
- `, jr = ({ gamification: t, className: o }) => {
81
- const s = m(t.openedQuestion.$store), i = m(t.openedUser);
82
- return /* @__PURE__ */ p(d, { children: [
83
- s && /* @__PURE__ */ r(e, { className: o, children: /* @__PURE__ */ r(f, { gamification: t }) }),
84
- i && /* @__PURE__ */ r(e, { className: o, children: /* @__PURE__ */ p(x, { children: [
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(h, { ...i }) })
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
- jr as GamificationOverlay,
93
- jr as default
95
+ kt as GamificationOverlay,
96
+ kt as default
94
97
  };
@@ -9,6 +9,6 @@ export interface UserStatisticsProps {
9
9
  correct?: number;
10
10
  incorrect?: number;
11
11
  inTop?: number;
12
- average?: number;
12
+ successRate?: number;
13
13
  }
14
14
  export declare const UserStatistics: React.FC<UserStatisticsProps>;
@@ -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
- average: O
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.0",
3
+ "version": "0.65.1",
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.7"
87
+ "@streamlayer/react": "^0.29.8"
88
88
  }
89
89
  }