@local-civics/mgmt-ui 0.1.137 → 0.1.138
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/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -705,7 +705,8 @@ const Badge = (props) => {
|
|
|
705
705
|
const { classes } = useStyles$l();
|
|
706
706
|
const [tab, setTab] = React.useState("lessons");
|
|
707
707
|
const numberOfStudents = props.students.length;
|
|
708
|
-
const
|
|
708
|
+
const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
|
|
709
|
+
numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
|
|
709
710
|
return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
|
|
710
711
|
core.Badge,
|
|
711
712
|
{
|
|
@@ -724,8 +725,8 @@ const Badge = (props) => {
|
|
|
724
725
|
))))), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React__namespace.createElement(core.LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(StatsGroup, { data: [
|
|
725
726
|
{
|
|
726
727
|
title: props.trial ? "LESSONS SUBMITTED" : "BADGE COMPLETION",
|
|
727
|
-
value: props.trial ? props.lessonsCompleted || 0 :
|
|
728
|
-
unit: props.trial ? "" : "
|
|
728
|
+
value: props.trial ? props.lessonsCompleted || 0 : numberOfBadges,
|
|
729
|
+
unit: props.trial ? "" : ""
|
|
729
730
|
}
|
|
730
731
|
] }), !props.trial && /* @__PURE__ */ React__namespace.createElement(
|
|
731
732
|
core.Select,
|
|
@@ -1917,7 +1918,8 @@ const Lesson = (props) => {
|
|
|
1917
1918
|
const { classes } = useStyles$d();
|
|
1918
1919
|
const [tab, setTab] = React.useState("question");
|
|
1919
1920
|
const numberOfStudents = props.students.length;
|
|
1920
|
-
const
|
|
1921
|
+
const numberOfLessons = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
|
|
1922
|
+
numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
|
|
1921
1923
|
const contributors = props.contributors || [];
|
|
1922
1924
|
const avatars = contributors.slice(0, 5).map((u, i) => {
|
|
1923
1925
|
const fullName = u.name;
|
|
@@ -1977,8 +1979,8 @@ const Lesson = (props) => {
|
|
|
1977
1979
|
data: [
|
|
1978
1980
|
{
|
|
1979
1981
|
title: props.trial ? "# OF SUBMISSIONS" : "LESSON COMPLETION",
|
|
1980
|
-
value: props.trial ? props.lessonsCompleted || 0 :
|
|
1981
|
-
unit: props.trial ? "" : "
|
|
1982
|
+
value: props.trial ? props.lessonsCompleted || 0 : numberOfLessons,
|
|
1983
|
+
unit: props.trial ? "" : ""
|
|
1982
1984
|
}
|
|
1983
1985
|
]
|
|
1984
1986
|
}
|