@local-civics/mgmt-ui 0.1.227 → 0.1.229

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
@@ -5,7 +5,7 @@ import { Avatar, createStyles, Modal, Center, Loader, Container, Group, Button,
5
5
  import { Link } from 'react-router-dom';
6
6
  import 'external-svg-loader';
7
7
  import { showNotification, NotificationsProvider } from '@mantine/notifications';
8
- export { showNotification, updateNotification } from '@mantine/notifications';
8
+ export { hideNotification, showNotification, updateNotification } from '@mantine/notifications';
9
9
  import { Dropzone, MIME_TYPES } from '@mantine/dropzone';
10
10
  import { useForm } from '@mantine/form';
11
11
  import * as papa from 'papaparse';
@@ -1154,7 +1154,15 @@ const DropzoneButton$1 = (props) => {
1154
1154
  worker: true,
1155
1155
  complete: function(results) {
1156
1156
  const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.members.filter((u) => u.email === v.email).length === 0);
1157
- data.length > 0 && props.onCreateMembers && props.onCreateMembers(data);
1157
+ if (data.length > 0) {
1158
+ props.onCreateMembers && props.onCreateMembers(data);
1159
+ } else {
1160
+ showNotification({
1161
+ title: "No new members found.",
1162
+ message: "Every row in that file was either invalid or already on this class's roster.",
1163
+ autoClose: 5e3
1164
+ });
1165
+ }
1158
1166
  setLoading(false);
1159
1167
  props.close();
1160
1168
  }
@@ -1505,6 +1513,11 @@ const Home = (props) => {
1505
1513
  });
1506
1514
  } catch (err) {
1507
1515
  console.error("Failed to copy code", err);
1516
+ showNotification({
1517
+ title: "Unable to copy code.",
1518
+ message: `Your browser blocked the copy - the community code is: ${accessCode}`,
1519
+ autoClose: false
1520
+ });
1508
1521
  }
1509
1522
  };
1510
1523
  return /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col gap-5" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-stretch gap-5" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React.createElement("div", { className: "text-[28px] font-extrabold text-dark-blue-400" }, props.name), /* @__PURE__ */ React.createElement("div", { className: "mt-1.5 text-[12.5px] text-slate-400" }, props.impactStatement)), /* @__PURE__ */ React.createElement("div", { className: "flex w-[440px] shrink-0 flex-col justify-between gap-3 rounded-2xl bg-gradient-to-br from-dark-blue-600 via-dark-blue-400 to-sky-blue-400 p-5" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-base font-extrabold text-white" }, props.organization.name), /* @__PURE__ */ React.createElement("div", { className: "mt-1.5 text-[11.5px] leading-relaxed text-white/70" }, props.organization.description)), accessCode && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement("span", { className: "text-[11px] text-white/70" }, "Community code: ", accessCode), /* @__PURE__ */ React.createElement(
@@ -2123,7 +2136,15 @@ const DropzoneButton = (props) => {
2123
2136
  worker: true,
2124
2137
  complete: function(results) {
2125
2138
  const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.users.filter((u) => u.email === v.email).length === 0);
2126
- data.length > 0 && props.onCreateUsers && props.onCreateUsers(data);
2139
+ if (data.length > 0) {
2140
+ props.onCreateUsers && props.onCreateUsers(data);
2141
+ } else {
2142
+ showNotification({
2143
+ title: "No new members found.",
2144
+ message: "Every row in that file was either invalid or already on this organization's roster.",
2145
+ autoClose: 5e3
2146
+ });
2147
+ }
2127
2148
  setLoading(false);
2128
2149
  props.close();
2129
2150
  }
@@ -2380,6 +2401,11 @@ const TenantBanner = (_a) => {
2380
2401
  });
2381
2402
  } catch (err) {
2382
2403
  console.error("Failed to copy code", err);
2404
+ showNotification({
2405
+ title: "Unable to copy code.",
2406
+ message: `Your browser blocked the copy - the community code is: ${code}`,
2407
+ autoClose: false
2408
+ });
2383
2409
  }
2384
2410
  };
2385
2411
  return /* @__PURE__ */ React.createElement(