@local-civics/mgmt-ui 0.1.136 → 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.d.ts +1 -0
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
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,
|
|
@@ -1478,7 +1479,6 @@ function Table$7(props) {
|
|
|
1478
1479
|
const Student = (props) => {
|
|
1479
1480
|
const [tab, setTab] = React.useState("badges");
|
|
1480
1481
|
const numberOfBadges = props.badges.length;
|
|
1481
|
-
const percentageOfBadgesEarned = numberOfBadges > 0 ? props.badges.filter((b) => b.isComplete).length / numberOfBadges : 0;
|
|
1482
1482
|
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, { gutter: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
|
|
1483
1483
|
core.Badge,
|
|
1484
1484
|
{
|
|
@@ -1501,13 +1501,13 @@ const Student = (props) => {
|
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
1503
|
title: "LESSON COMPLETION",
|
|
1504
|
-
value: props.
|
|
1505
|
-
unit: "
|
|
1504
|
+
value: props.numberOfLessonsCompleted,
|
|
1505
|
+
unit: ""
|
|
1506
1506
|
},
|
|
1507
1507
|
{
|
|
1508
1508
|
title: "BADGE COMPLETION",
|
|
1509
|
-
value:
|
|
1510
|
-
unit: "
|
|
1509
|
+
value: numberOfBadges,
|
|
1510
|
+
unit: ""
|
|
1511
1511
|
}
|
|
1512
1512
|
] }), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
|
|
1513
1513
|
Tabs,
|
|
@@ -1918,7 +1918,8 @@ const Lesson = (props) => {
|
|
|
1918
1918
|
const { classes } = useStyles$d();
|
|
1919
1919
|
const [tab, setTab] = React.useState("question");
|
|
1920
1920
|
const numberOfStudents = props.students.length;
|
|
1921
|
-
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;
|
|
1922
1923
|
const contributors = props.contributors || [];
|
|
1923
1924
|
const avatars = contributors.slice(0, 5).map((u, i) => {
|
|
1924
1925
|
const fullName = u.name;
|
|
@@ -1978,8 +1979,8 @@ const Lesson = (props) => {
|
|
|
1978
1979
|
data: [
|
|
1979
1980
|
{
|
|
1980
1981
|
title: props.trial ? "# OF SUBMISSIONS" : "LESSON COMPLETION",
|
|
1981
|
-
value: props.trial ? props.lessonsCompleted || 0 :
|
|
1982
|
-
unit: props.trial ? "" : "
|
|
1982
|
+
value: props.trial ? props.lessonsCompleted || 0 : numberOfLessons,
|
|
1983
|
+
unit: props.trial ? "" : ""
|
|
1983
1984
|
}
|
|
1984
1985
|
]
|
|
1985
1986
|
}
|