@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.mjs CHANGED
@@ -685,7 +685,8 @@ const Badge = (props) => {
685
685
  const { classes } = useStyles$l();
686
686
  const [tab, setTab] = useState("lessons");
687
687
  const numberOfStudents = props.students.length;
688
- const percentageOfBadgesEarned = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
688
+ const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
689
+ numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
689
690
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$4, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React.createElement(
690
691
  Badge$1,
691
692
  {
@@ -704,8 +705,8 @@ const Badge = (props) => {
704
705
  ))))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React.createElement(LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React.createElement(Stack$4, null, /* @__PURE__ */ React.createElement(StatsGroup, { data: [
705
706
  {
706
707
  title: props.trial ? "LESSONS SUBMITTED" : "BADGE COMPLETION",
707
- value: props.trial ? props.lessonsCompleted || 0 : percentageOfBadgesEarned,
708
- unit: props.trial ? "" : "%"
708
+ value: props.trial ? props.lessonsCompleted || 0 : numberOfBadges,
709
+ unit: props.trial ? "" : ""
709
710
  }
710
711
  ] }), !props.trial && /* @__PURE__ */ React.createElement(
711
712
  Select,
@@ -1458,7 +1459,6 @@ function Table$7(props) {
1458
1459
  const Student = (props) => {
1459
1460
  const [tab, setTab] = useState("badges");
1460
1461
  const numberOfBadges = props.badges.length;
1461
- const percentageOfBadgesEarned = numberOfBadges > 0 ? props.badges.filter((b) => b.isComplete).length / numberOfBadges : 0;
1462
1462
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$4, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, { gutter: "md" }, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React.createElement(
1463
1463
  Badge$1,
1464
1464
  {
@@ -1481,13 +1481,13 @@ const Student = (props) => {
1481
1481
  },
1482
1482
  {
1483
1483
  title: "LESSON COMPLETION",
1484
- value: props.percentageOfLessonsCompleted,
1485
- unit: "%"
1484
+ value: props.numberOfLessonsCompleted,
1485
+ unit: ""
1486
1486
  },
1487
1487
  {
1488
1488
  title: "BADGE COMPLETION",
1489
- value: percentageOfBadgesEarned,
1490
- unit: "%"
1489
+ value: numberOfBadges,
1490
+ unit: ""
1491
1491
  }
1492
1492
  ] }), /* @__PURE__ */ React.createElement(Stack$4, { spacing: 0 }, /* @__PURE__ */ React.createElement(
1493
1493
  Tabs,
@@ -1898,7 +1898,8 @@ const Lesson = (props) => {
1898
1898
  const { classes } = useStyles$d();
1899
1899
  const [tab, setTab] = useState("question");
1900
1900
  const numberOfStudents = props.students.length;
1901
- const percentageOfLessonsCompleted = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
1901
+ const numberOfLessons = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
1902
+ numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
1902
1903
  const contributors = props.contributors || [];
1903
1904
  const avatars = contributors.slice(0, 5).map((u, i) => {
1904
1905
  const fullName = u.name;
@@ -1958,8 +1959,8 @@ const Lesson = (props) => {
1958
1959
  data: [
1959
1960
  {
1960
1961
  title: props.trial ? "# OF SUBMISSIONS" : "LESSON COMPLETION",
1961
- value: props.trial ? props.lessonsCompleted || 0 : percentageOfLessonsCompleted,
1962
- unit: props.trial ? "" : "%"
1962
+ value: props.trial ? props.lessonsCompleted || 0 : numberOfLessons,
1963
+ unit: props.trial ? "" : ""
1963
1964
  }
1964
1965
  ]
1965
1966
  }