@local-civics/mgmt-ui 0.1.82 → 0.1.84
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 +3 -0
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ interface NavbarProps {
|
|
|
16
16
|
hidden?: boolean;
|
|
17
17
|
}>;
|
|
18
18
|
trial?: boolean;
|
|
19
|
+
loading?: boolean;
|
|
19
20
|
onLogout: () => void;
|
|
20
21
|
onSwitchAccounts?: () => void;
|
|
21
22
|
}
|
|
@@ -105,6 +106,7 @@ type BadgeProps = {
|
|
|
105
106
|
students: BadgeUserItem[];
|
|
106
107
|
href: string;
|
|
107
108
|
trial?: boolean;
|
|
109
|
+
badgesEarned?: number;
|
|
108
110
|
onBackClick: () => void;
|
|
109
111
|
onClassChange: (classId: string) => void;
|
|
110
112
|
onCopyLinkClick: () => void;
|
|
@@ -446,6 +448,7 @@ type LessonProps = {
|
|
|
446
448
|
reflections: Item$5[];
|
|
447
449
|
questions: Item$2[];
|
|
448
450
|
trial?: boolean;
|
|
451
|
+
lessonsCompleted?: number;
|
|
449
452
|
onBackClick: () => void;
|
|
450
453
|
onClassChange: (classId: string) => void;
|
|
451
454
|
onCopyLinkClick: () => void;
|
package/dist/index.js
CHANGED
|
@@ -308,6 +308,9 @@ function Navbar(props) {
|
|
|
308
308
|
if (context.hidden || props.trial && TRIAL_PAGES.indexOf(item.label) === -1) {
|
|
309
309
|
return null;
|
|
310
310
|
}
|
|
311
|
+
if (props.loading && item.label !== "Home") {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
311
314
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
312
315
|
LinksGroup,
|
|
313
316
|
__spreadProps$5(__spreadValues$8(__spreadValues$8({
|
|
@@ -320,7 +323,7 @@ function Navbar(props) {
|
|
|
320
323
|
})
|
|
321
324
|
);
|
|
322
325
|
});
|
|
323
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { sm: 300 }, p: "md", className: cx(classes.navbar, { [classes.navHeader]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.header }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Code, { sx: { fontWeight: 700 } }, props.version), !!props.trial && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", radius: "xs" }, "Trial"), /* @__PURE__ */ React__namespace.createElement(core.Burger, { opened: burgerOpen, onClick: toggle, className: classes.burger, size: "sm" })))), /* @__PURE__ */ React__namespace.createElement("div", { className: cx({ [classes.navBody]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(
|
|
326
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { sm: 300 }, p: "md", className: cx(classes.navbar, { [classes.navHeader]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.header }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Code, { sx: { fontWeight: 700 } }, props.version), !!props.trial && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", radius: "xs" }, "Trial"), /* @__PURE__ */ React__namespace.createElement(core.Burger, { opened: burgerOpen, onClick: toggle, className: classes.burger, size: "sm" })))), /* @__PURE__ */ React__namespace.createElement("div", { className: cx({ [classes.navBody]: !burgerOpen }) }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
|
|
324
327
|
UserButton,
|
|
325
328
|
{
|
|
326
329
|
className: classes.user,
|
|
@@ -328,7 +331,7 @@ function Navbar(props) {
|
|
|
328
331
|
name: props.name,
|
|
329
332
|
email: props.email
|
|
330
333
|
}
|
|
331
|
-
), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, className: classes.links, component: core.ScrollArea }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.linksInner }, links)), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.footer }, !!props.onSwitchAccounts && /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
|
|
334
|
+
), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, className: classes.links, component: core.ScrollArea }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.linksInner }, links)), !props.loading && /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.footer }, !!props.onSwitchAccounts && /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
|
|
332
335
|
event.preventDefault();
|
|
333
336
|
props.onSwitchAccounts && props.onSwitchAccounts();
|
|
334
337
|
} }, /* @__PURE__ */ React__namespace.createElement(icons.IconSwitchHorizontal, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Change account")), /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
|
|
@@ -670,9 +673,9 @@ const Badge = (props) => {
|
|
|
670
673
|
}
|
|
671
674
|
))))), /* @__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: [
|
|
672
675
|
{
|
|
673
|
-
title: "BADGE COMPLETION",
|
|
674
|
-
value: percentageOfBadgesEarned,
|
|
675
|
-
unit: "%"
|
|
676
|
+
title: props.trial ? "LESSONS SUBMITTED" : "BADGE COMPLETION",
|
|
677
|
+
value: props.trial ? props.badgesEarned || 0 : percentageOfBadgesEarned,
|
|
678
|
+
unit: props.trial ? "" : "%"
|
|
676
679
|
}
|
|
677
680
|
] }), !props.trial && /* @__PURE__ */ React__namespace.createElement(
|
|
678
681
|
core.Select,
|
|
@@ -1905,9 +1908,9 @@ const Lesson = (props) => {
|
|
|
1905
1908
|
}
|
|
1906
1909
|
))))), /* @__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: [
|
|
1907
1910
|
{
|
|
1908
|
-
title: "LESSON COMPLETION",
|
|
1909
|
-
value: percentageOfLessonsCompleted,
|
|
1910
|
-
unit: "%"
|
|
1911
|
+
title: props.trial ? "# OF SUBMISSIONS" : "LESSON COMPLETION",
|
|
1912
|
+
value: props.trial ? props.lessonsCompleted || 0 : percentageOfLessonsCompleted,
|
|
1913
|
+
unit: props.trial ? "" : "%"
|
|
1911
1914
|
}
|
|
1912
1915
|
] }), !props.trial && /* @__PURE__ */ React__namespace.createElement(
|
|
1913
1916
|
core.Select,
|
|
@@ -2400,9 +2403,9 @@ const DropzoneButton = (props) => {
|
|
|
2400
2403
|
const useStyles$3 = core.createStyles((theme) => ({
|
|
2401
2404
|
wrapper: {
|
|
2402
2405
|
minHeight: 400,
|
|
2406
|
+
height: "100%",
|
|
2403
2407
|
boxSizing: "border-box",
|
|
2404
2408
|
backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
|
|
2405
|
-
borderRadius: theme.radius.md,
|
|
2406
2409
|
padding: theme.spacing.xl * 2.5,
|
|
2407
2410
|
[`@media (max-width: ${theme.breakpoints.sm}px)`]: {
|
|
2408
2411
|
padding: theme.spacing.xl * 1.5
|
|
@@ -2449,7 +2452,7 @@ const useStyles$3 = core.createStyles((theme) => ({
|
|
|
2449
2452
|
}));
|
|
2450
2453
|
const StartAnonymousLesson = (props) => {
|
|
2451
2454
|
const { classes } = useStyles$3();
|
|
2452
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { cols: 2, spacing: 50, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: "bold", className: classes.description, mt: "sm", mb: 30 }, "Instructor: ", props.educatorName), /* @__PURE__ */ React__namespace.createElement(core.Text, { className: classes.description, mt: "sm", mb: 30 }, props.description)), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(
|
|
2455
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { maw: 960, ml: "auto", mr: "auto", cols: 2, spacing: 50, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: "bold", className: classes.description, mt: "sm", mb: 30 }, "Instructor: ", props.educatorName), /* @__PURE__ */ React__namespace.createElement(core.Text, { className: classes.description, mt: "sm", mb: 30 }, props.description)), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(
|
|
2453
2456
|
core.TextInput,
|
|
2454
2457
|
{
|
|
2455
2458
|
label: "Name",
|