@churchapps/apphelper 0.3.4 → 0.3.6
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/components/header/SiteHeader.d.ts.map +1 -1
- package/dist/components/header/SiteHeader.js +44 -1
- package/dist/components/header/SiteHeader.js.map +1 -1
- package/dist/components/header/SupportDrawer.d.ts +7 -0
- package/dist/components/header/SupportDrawer.d.ts.map +1 -0
- package/dist/components/header/SupportDrawer.js +49 -0
- package/dist/components/header/SupportDrawer.js.map +1 -0
- package/package.json +1 -1
- package/src/components/header/SiteHeader.tsx +35 -3
- package/src/components/header/SupportDrawer.tsx +109 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteHeader.d.ts","sourceRoot":"","sources":["../../../src/components/header/SiteHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SiteHeader.d.ts","sourceRoot":"","sources":["../../../src/components/header/SiteHeader.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,KAAK,KAAK,GAAG;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAA;AAED,eAAO,MAAM,UAAU,UAAU,KAAK,4CA6DrC,CAAA"}
|
|
@@ -9,6 +9,7 @@ const PersonHelper_1 = require("../../helpers/PersonHelper");
|
|
|
9
9
|
const PrimaryMenu_1 = require("./PrimaryMenu");
|
|
10
10
|
const SecondaryMenu_1 = require("./SecondaryMenu");
|
|
11
11
|
const SecondaryMenuAlt_1 = require("./SecondaryMenuAlt");
|
|
12
|
+
const SupportDrawer_1 = require("./SupportDrawer");
|
|
12
13
|
const SiteHeader = (props) => {
|
|
13
14
|
var _a, _b, _c;
|
|
14
15
|
const CustomAppBar = (0, material_1.styled)(material_1.AppBar)(({ theme }) => ({
|
|
@@ -19,8 +20,50 @@ const SiteHeader = (props) => {
|
|
|
19
20
|
}),
|
|
20
21
|
"& .MuiIcon-root": { color: "#FFFFFF" }
|
|
21
22
|
}));
|
|
23
|
+
const getRelatedArticles = () => {
|
|
24
|
+
let result = [];
|
|
25
|
+
if (props.appName === "CHUMS") {
|
|
26
|
+
if (props.primaryMenuLabel === "People") {
|
|
27
|
+
if (props.secondaryMenuLabel === "People")
|
|
28
|
+
result = ["chums/adding-people", "chums/advanced-search", "chums/assigning-roles"];
|
|
29
|
+
else if (props.secondaryMenuLabel === "Groups")
|
|
30
|
+
result = ["chums/group-roster", "chums/groups", "chums/group-calendar"];
|
|
31
|
+
else if (props.secondaryMenuLabel === "Attendance")
|
|
32
|
+
result = ["chums/attendance", "chums/checkin"];
|
|
33
|
+
}
|
|
34
|
+
else if (props.primaryMenuLabel === "Donations") {
|
|
35
|
+
if (props.secondaryMenuLabel === "Summary")
|
|
36
|
+
result = ["chums/donation-report"];
|
|
37
|
+
else if (props.secondaryMenuLabel === "Batches" || props.secondaryMenuLabel === "Funds")
|
|
38
|
+
result = ["chums/giving", "chums/manual-input"];
|
|
39
|
+
}
|
|
40
|
+
else if (props.primaryMenuLabel === "Serving") {
|
|
41
|
+
if (props.secondaryMenuLabel === "Plans")
|
|
42
|
+
result = ["chums/plans"];
|
|
43
|
+
else if (props.secondaryMenuLabel === "Tasks")
|
|
44
|
+
result = ["chums/tasks", "chums/automations"];
|
|
45
|
+
}
|
|
46
|
+
else if (props.primaryMenuLabel === "Settings") {
|
|
47
|
+
if (props.secondaryMenuLabel === "Settings")
|
|
48
|
+
result = ["chums/assigning-roles", "chums/exporting-data", "chums/import-csv", "chums/import-from-breeze"];
|
|
49
|
+
else if (props.secondaryMenuLabel === "Forms")
|
|
50
|
+
result = ["chums/forms"];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else if (props.appName === "B1") {
|
|
54
|
+
if (props.primaryMenuLabel === "Mobile App")
|
|
55
|
+
result = ["b1/admin/portal", "b1/mobile/setup"];
|
|
56
|
+
else if (props.primaryMenuLabel === "Website")
|
|
57
|
+
result = ["b1/admin/portal", "b1/admin/website-elements", "b1/admin/website-setup"];
|
|
58
|
+
else if (props.primaryMenuLabel === "Sermons")
|
|
59
|
+
result = ["b1/admin/sermons", "b1/admin/stream-setup"];
|
|
60
|
+
else if (props.primaryMenuLabel === "Calendars")
|
|
61
|
+
result = ["b1/portal/calendars"];
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
22
65
|
/*<Typography variant="h6" noWrap>{UserHelper.currentUserChurch?.church?.name || ""}</Typography>*/
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: "var(--c1)", color: "#FFF" }, children: (0, jsx_runtime_1.jsx)(CustomAppBar, { position: "absolute", children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { sx: { pr: "24px", backgroundColor: "var(--c1)" }, children: [(0, jsx_runtime_1.jsx)(PrimaryMenu_1.PrimaryMenu, { label: props.primaryMenuLabel, menuItems: props.primaryMenuItems, onNavigate: props.onNavigate }), (0, jsx_runtime_1.jsx)(SecondaryMenu_1.SecondaryMenu, { label: props.secondaryMenuLabel, menuItems: props.secondaryMenuItems, onNavigate: props.onNavigate }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(SecondaryMenuAlt_1.SecondaryMenuAlt, { label: props.secondaryMenuLabel, menuItems: props.secondaryMenuItems, onNavigate: props.onNavigate }) }), UserHelper_1.UserHelper.user && (0, jsx_runtime_1.jsx)(UserMenu_1.UserMenu, { profilePicture: PersonHelper_1.PersonHelper.getPhotoUrl((_a = props.context) === null || _a === void 0 ? void 0 : _a.person), userName: `${(_b = UserHelper_1.UserHelper.user) === null || _b === void 0 ? void 0 : _b.firstName} ${(_c = UserHelper_1.UserHelper.user) === null || _c === void 0 ? void 0 : _c.lastName}`, userChurches: UserHelper_1.UserHelper.userChurches, currentUserChurch: UserHelper_1.UserHelper.currentUserChurch, context: props.context, appName: props.appName, loadCounts: () => { }, notificationCounts: { notificationCount: 0, pmCount: 0 }, onNavigate: props.onNavigate }), !UserHelper_1.UserHelper.user && (0, jsx_runtime_1.jsx)(material_1.Link, { href: "/login", color: "inherit", style: { textDecoration: "none" }, children: "Login" })] }) }) }) }));
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: "var(--c1)", color: "#FFF" }, children: (0, jsx_runtime_1.jsx)(CustomAppBar, { position: "absolute", children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { sx: { pr: "24px", backgroundColor: "var(--c1)" }, children: [(0, jsx_runtime_1.jsx)(PrimaryMenu_1.PrimaryMenu, { label: props.primaryMenuLabel, menuItems: props.primaryMenuItems, onNavigate: props.onNavigate }), (0, jsx_runtime_1.jsx)(SecondaryMenu_1.SecondaryMenu, { label: props.secondaryMenuLabel, menuItems: props.secondaryMenuItems, onNavigate: props.onNavigate }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(SecondaryMenuAlt_1.SecondaryMenuAlt, { label: props.secondaryMenuLabel, menuItems: props.secondaryMenuItems, onNavigate: props.onNavigate }) }), UserHelper_1.UserHelper.user && (0, jsx_runtime_1.jsx)(UserMenu_1.UserMenu, { profilePicture: PersonHelper_1.PersonHelper.getPhotoUrl((_a = props.context) === null || _a === void 0 ? void 0 : _a.person), userName: `${(_b = UserHelper_1.UserHelper.user) === null || _b === void 0 ? void 0 : _b.firstName} ${(_c = UserHelper_1.UserHelper.user) === null || _c === void 0 ? void 0 : _c.lastName}`, userChurches: UserHelper_1.UserHelper.userChurches, currentUserChurch: UserHelper_1.UserHelper.currentUserChurch, context: props.context, appName: props.appName, loadCounts: () => { }, notificationCounts: { notificationCount: 0, pmCount: 0 }, onNavigate: props.onNavigate }), !UserHelper_1.UserHelper.user && (0, jsx_runtime_1.jsx)(material_1.Link, { href: "/login", color: "inherit", style: { textDecoration: "none" }, children: "Login" }), (0, jsx_runtime_1.jsx)(SupportDrawer_1.SupportDrawer, { appName: props.appName, relatedArticles: getRelatedArticles() })] }) }) }) }));
|
|
24
67
|
};
|
|
25
68
|
exports.SiteHeader = SiteHeader;
|
|
26
69
|
//# sourceMappingURL=SiteHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteHeader.js","sourceRoot":"","sources":["../../../src/components/header/SiteHeader.tsx"],"names":[],"mappings":";;;;AACA,4CAA8D;AAC9D,yDAAqD;AACrD,kDAA+C;AAC/C,6DAA0D;AAC1D,+CAA4C;AAC5C,mDAAgD;AAChD,yDAAsD;
|
|
1
|
+
{"version":3,"file":"SiteHeader.js","sourceRoot":"","sources":["../../../src/components/header/SiteHeader.tsx"],"names":[],"mappings":";;;;AACA,4CAA8D;AAC9D,yDAAqD;AACrD,kDAA+C;AAC/C,6DAA0D;AAC1D,+CAA4C;AAC5C,mDAAgD;AAChD,yDAAsD;AACtD,mDAAgD;AAazC,MAAM,UAAU,GAAG,CAAC,KAAW,EAAE,EAAE;;IAExC,MAAM,YAAY,GAAG,IAAA,iBAAM,EAAC,iBAAM,CAAC,CACjC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QA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AAE,kBAAkB,EAAE,GAAI,IACxE,GACG,GAEX,GACL,CACF,CAAC;AACJ,CAAC,CAAA;AA7DY,QAAA,UAAU,cA6DtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/header/SupportDrawer.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,KAAK,4CAmGzC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupportDrawer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const helpers_1 = require("../../helpers");
|
|
8
|
+
const SupportDrawer = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
11
|
+
const [supportContact, setSupportContact] = (0, react_1.useState)(null);
|
|
12
|
+
const [churchLogo, setChurchLogo] = (0, react_1.useState)(null);
|
|
13
|
+
const supportHref = "https://support.churchapps.org/";
|
|
14
|
+
let currentAppName = "";
|
|
15
|
+
if (props.appName === "CHUMS")
|
|
16
|
+
currentAppName = "chums";
|
|
17
|
+
if (props.appName === "B1")
|
|
18
|
+
currentAppName = "b1";
|
|
19
|
+
const validateEmail = (email) => {
|
|
20
|
+
return email.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
|
|
21
|
+
};
|
|
22
|
+
const handleChurchSupportClick = () => {
|
|
23
|
+
if (validateEmail(supportContact.value)) {
|
|
24
|
+
window.location.href = `mailto:${supportContact.value}`;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
window.open(`http://${supportContact.value}`, "_blank").focus();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const loadData = () => {
|
|
31
|
+
helpers_1.ApiHelper.get("/settings", "MembershipApi").then((data) => {
|
|
32
|
+
const contactRes = data.filter((d) => d.keyName === "supportContact");
|
|
33
|
+
if ((contactRes === null || contactRes === void 0 ? void 0 : contactRes.length) > 0 && contactRes[0].value !== "")
|
|
34
|
+
setSupportContact(contactRes[0]);
|
|
35
|
+
const logoRes = data.filter((d) => d.keyName === "favicon_16x16");
|
|
36
|
+
if ((logoRes === null || logoRes === void 0 ? void 0 : logoRes.length) > 0 && logoRes[0].value !== "")
|
|
37
|
+
setChurchLogo(logoRes[0]);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
(0, react_1.useEffect)(loadData, []);
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { sx: { color: "white !important", borderRadius: 2 }, onClick: () => setOpen(true), children: (0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { fontSize: "26px !important" }, children: "help" }) }), (0, jsx_runtime_1.jsx)(material_1.Drawer, { open: open, onClose: () => setOpen(false), anchor: "right", PaperProps: { sx: { width: { xs: "80%", sm: "40%", md: "30%", lg: "20%" } } }, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { paddingTop: 10, display: "flex", flexDirection: "column", justifyContent: "space-between", minHeight: "98vh" }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { children: [supportContact ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: "flex", justifyContent: "end", alignItems: "center" }, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { cursor: "pointer", display: "flex", justifyContent: "center", alignItems: "center", marginRight: 2, borderRadius: 2, padding: "7px", backgroundColor: "#e9e9e9" }, component: "div", onClick: () => handleChurchSupportClick(), children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "rounded", src: churchLogo ? churchLogo.value : null, sx: { marginRight: 1, bgcolor: "#568bda", width: 25, height: 25 }, children: (0, jsx_runtime_1.jsx)(material_1.Icon, { fontSize: "small", children: "church" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: "#568bda", fontSize: "13px" }, children: "Support" })] }) })) : null, (0, jsx_runtime_1.jsx)(material_1.List, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { disablePadding: true, children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { href: supportHref + currentAppName, target: "_blank", rel: "noopener noreferrer", children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: { minWidth: "38px" }, children: (0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { color: "#568bda" }, children: "article" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { sx: { color: "#568bda" }, children: "View Documentation" })] }) }) }), ((_a = props === null || props === void 0 ? void 0 : props.relatedArticles) === null || _a === void 0 ? void 0 : _a.length) > 0 ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { marginTop: 2 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: "#568bda", textDecoration: "underline", textUnderlineOffset: 10, textDecorationThickness: 2, marginLeft: 2 }, children: "Features Tour" }), (0, jsx_runtime_1.jsx)(material_1.List, { sx: { marginTop: 1.5 }, children: props.relatedArticles.map((a) => {
|
|
42
|
+
const parts = a.split("/");
|
|
43
|
+
const lastPart = parts[parts.length - 1];
|
|
44
|
+
const result = lastPart.replace("-", " ");
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ListItem, { disablePadding: true, children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { href: supportHref + a, target: "_blank", rel: "noopener noreferrer", children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: { minWidth: "35px" }, children: (0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { color: "#568bda" }, children: "play_circle" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: "#568bda", textTransform: "capitalize" }, fontSize: "15px", children: result }) })] }) }));
|
|
46
|
+
}) })] })) : null] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { marginRight: 4, marginLeft: 4, marginTop: "auto" }, children: [(0, jsx_runtime_1.jsx)("hr", { style: { color: "#568bda", borderColor: "#568bda", marginLeft: -13, marginRight: -13 } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", color: "#568bda", marginBottom: 1.5, marginTop: 1.5 }, children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { src: "https://avatars.githubusercontent.com/u/74469593?s=200&v=4", variant: "rounded", sx: { width: 25, height: 25, marginRight: 1 }, children: "C" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "ChurchApps" })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 4, marginBottom: 1 }, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", size: "small", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { fontSize: "small", children: "mail" }), fullWidth: true, sx: { backgroundColor: "#568bda" }, children: "Support" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", size: "small", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { fontSize: "small", children: "forum" }), fullWidth: true, sx: { backgroundColor: "#568bda" }, href: "https://github.com/orgs/ChurchApps/discussions", target: "_blank", rel: "noopener noreferrer", children: "Forum" })] })] })] }) })] }));
|
|
47
|
+
};
|
|
48
|
+
exports.SupportDrawer = SupportDrawer;
|
|
49
|
+
//# sourceMappingURL=SupportDr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AAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,uBAAC,eAAI,IAAC,QAAQ,EAAC,OAAO,qBAAY,EAAE,SAAS,QAAC,EAAE,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,wBAAkB,EACtJ,uBAAC,iBAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,uBAAC,eAAI,IAAC,QAAQ,EAAC,OAAO,sBAAa,EAAE,SAAS,QAAC,EAAE,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,IAAI,EAAC,gDAAgD,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,sBAAe,IACjP,IACF,IACF,GACC,IACR,CACJ,CAAC;AACJ,CAAC,CAAC;AAnGW,QAAA,aAAa,iBAmGxB"}
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { PersonHelper } from "../../helpers/PersonHelper";
|
|
|
6
6
|
import { PrimaryMenu } from "./PrimaryMenu";
|
|
7
7
|
import { SecondaryMenu } from "./SecondaryMenu";
|
|
8
8
|
import { SecondaryMenuAlt } from "./SecondaryMenuAlt";
|
|
9
|
+
import { SupportDrawer } from "./SupportDrawer";
|
|
9
10
|
import { UserContextInterface } from "@churchapps/helpers";
|
|
10
11
|
|
|
11
12
|
type Props = {
|
|
@@ -13,9 +14,9 @@ type Props = {
|
|
|
13
14
|
primaryMenuItems:{ url: string, icon:string, label: string }[];
|
|
14
15
|
secondaryMenuLabel: string;
|
|
15
16
|
secondaryMenuItems:{ url: string, label: string }[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
context: UserContextInterface;
|
|
18
|
+
appName: string;
|
|
19
|
+
onNavigate: (url: string) => void;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const SiteHeader = (props:Props) => {
|
|
@@ -30,6 +31,36 @@ export const SiteHeader = (props:Props) => {
|
|
|
30
31
|
"& .MuiIcon-root": { color: "#FFFFFF" }
|
|
31
32
|
})
|
|
32
33
|
);
|
|
34
|
+
|
|
35
|
+
const getRelatedArticles = () => {
|
|
36
|
+
let result: any [] = [];
|
|
37
|
+
if (props.appName === "CHUMS") {
|
|
38
|
+
if (props.primaryMenuLabel === "People") {
|
|
39
|
+
if (props.secondaryMenuLabel === "People") result = ["chums/adding-people", "chums/advanced-search", "chums/assigning-roles"];
|
|
40
|
+
else if (props.secondaryMenuLabel === "Groups") result = ["chums/group-roster", "chums/groups", "chums/group-calendar"];
|
|
41
|
+
else if (props.secondaryMenuLabel === "Attendance") result = ["chums/attendance", "chums/checkin"];
|
|
42
|
+
}
|
|
43
|
+
else if (props.primaryMenuLabel === "Donations") {
|
|
44
|
+
if (props.secondaryMenuLabel === "Summary") result = ["chums/donation-report"];
|
|
45
|
+
else if (props.secondaryMenuLabel === "Batches" || props.secondaryMenuLabel === "Funds") result = ["chums/giving", "chums/manual-input"];
|
|
46
|
+
}
|
|
47
|
+
else if (props.primaryMenuLabel === "Serving") {
|
|
48
|
+
if (props.secondaryMenuLabel === "Plans") result = ["chums/plans"];
|
|
49
|
+
else if (props.secondaryMenuLabel === "Tasks") result = ["chums/tasks", "chums/automations"];
|
|
50
|
+
}
|
|
51
|
+
else if (props.primaryMenuLabel === "Settings") {
|
|
52
|
+
if (props.secondaryMenuLabel === "Settings") result = ["chums/assigning-roles", "chums/exporting-data", "chums/import-csv", "chums/import-from-breeze"];
|
|
53
|
+
else if (props.secondaryMenuLabel === "Forms") result = ["chums/forms"];
|
|
54
|
+
}
|
|
55
|
+
} else if (props.appName === "B1") {
|
|
56
|
+
if (props.primaryMenuLabel === "Mobile App") result = ["b1/admin/portal", "b1/mobile/setup"];
|
|
57
|
+
else if (props.primaryMenuLabel === "Website") result = ["b1/admin/portal", "b1/admin/website-elements", "b1/admin/website-setup"];
|
|
58
|
+
else if (props.primaryMenuLabel === "Sermons") result = ["b1/admin/sermons", "b1/admin/stream-setup"];
|
|
59
|
+
else if (props.primaryMenuLabel === "Calendars") result = ["b1/portal/calendars"];
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
|
|
33
64
|
/*<Typography variant="h6" noWrap>{UserHelper.currentUserChurch?.church?.name || ""}</Typography>*/
|
|
34
65
|
return (<>
|
|
35
66
|
<div style={{backgroundColor:"var(--c1)", color: "#FFF"}}>
|
|
@@ -42,6 +73,7 @@ export const SiteHeader = (props:Props) => {
|
|
|
42
73
|
</div>
|
|
43
74
|
{UserHelper.user && <UserMenu profilePicture={PersonHelper.getPhotoUrl(props.context?.person)} userName={`${UserHelper.user?.firstName} ${UserHelper.user?.lastName}`} userChurches={UserHelper.userChurches} currentUserChurch={UserHelper.currentUserChurch} context={props.context} appName={props.appName} loadCounts={() => {}} notificationCounts={{notificationCount:0, pmCount:0}} onNavigate={props.onNavigate} />}
|
|
44
75
|
{!UserHelper.user && <Link href="/login" color="inherit" style={{ textDecoration: "none" }}>Login</Link>}
|
|
76
|
+
<SupportDrawer appName={props.appName} relatedArticles={getRelatedArticles()} />
|
|
45
77
|
</Toolbar>
|
|
46
78
|
</CustomAppBar>
|
|
47
79
|
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Avatar, Box, Button, Drawer, Icon, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Typography } from "@mui/material";
|
|
3
|
+
import { ApiHelper, GenericSettingInterface } from "../../helpers";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
appName: string;
|
|
7
|
+
relatedArticles?: string[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const SupportDrawer = (props: Props) => {
|
|
11
|
+
const [open, setOpen] = useState<boolean>(false);
|
|
12
|
+
const [supportContact, setSupportContact] = useState<GenericSettingInterface>(null);
|
|
13
|
+
const [churchLogo, setChurchLogo] = useState<GenericSettingInterface>(null);
|
|
14
|
+
const supportHref = "https://support.churchapps.org/";
|
|
15
|
+
|
|
16
|
+
let currentAppName = "";
|
|
17
|
+
if (props.appName === "CHUMS") currentAppName = "chums";
|
|
18
|
+
if (props.appName === "B1") currentAppName = "b1";
|
|
19
|
+
|
|
20
|
+
const validateEmail = (email: string) => {
|
|
21
|
+
return email.match(
|
|
22
|
+
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const handleChurchSupportClick = () => {
|
|
27
|
+
if (validateEmail(supportContact.value)) {
|
|
28
|
+
window.location.href = `mailto:${supportContact.value}`;
|
|
29
|
+
} else {
|
|
30
|
+
window.open(`http://${supportContact.value}`, "_blank").focus();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const loadData = () => {
|
|
35
|
+
ApiHelper.get("/settings", "MembershipApi").then((data: GenericSettingInterface[]) => {
|
|
36
|
+
const contactRes = data.filter((d) => d.keyName === "supportContact");
|
|
37
|
+
if (contactRes?.length > 0 && contactRes[0].value !== "") setSupportContact(contactRes[0]);
|
|
38
|
+
|
|
39
|
+
const logoRes = data.filter((d) => d.keyName === "favicon_16x16");
|
|
40
|
+
if (logoRes?.length > 0 && logoRes[0].value !== "") setChurchLogo(logoRes[0]);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
useEffect(loadData, []);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<IconButton sx={{ color: "white !important", borderRadius: 2 }} onClick={() => setOpen(true)}>
|
|
49
|
+
<Icon sx={{ fontSize: "26px !important" }}>help</Icon>
|
|
50
|
+
</IconButton>
|
|
51
|
+
<Drawer open={open} onClose={() => setOpen(false)} anchor="right" PaperProps={{ sx: { width: { xs: "80%", sm: "40%", md: "30%", lg: "20%" } } }}>
|
|
52
|
+
<Box
|
|
53
|
+
sx={{ paddingTop: 10, display: "flex", flexDirection: "column", justifyContent: "space-between", minHeight: "98vh" }}>
|
|
54
|
+
<Box>
|
|
55
|
+
{supportContact ? (
|
|
56
|
+
<Box sx={{ display: "flex", justifyContent: "end", alignItems: "center" }}>
|
|
57
|
+
<Box sx={{ cursor: "pointer", display: "flex", justifyContent: "center", alignItems: "center", marginRight: 2, borderRadius: 2, padding: "7px", backgroundColor: "#e9e9e9" }} component="div" onClick={() => handleChurchSupportClick()}>
|
|
58
|
+
<Avatar variant="rounded" src={churchLogo ? churchLogo.value : null} sx={{ marginRight: 1, bgcolor: "#568bda", width: 25, height: 25 }}>
|
|
59
|
+
<Icon fontSize="small">church</Icon>
|
|
60
|
+
</Avatar>
|
|
61
|
+
<Typography sx={{ color: "#568bda", fontSize: "13px" }}>Support</Typography>
|
|
62
|
+
</Box>
|
|
63
|
+
</Box>
|
|
64
|
+
) : null}
|
|
65
|
+
<List>
|
|
66
|
+
<ListItem disablePadding>
|
|
67
|
+
<ListItemButton href={supportHref + currentAppName} target="_blank" rel="noopener noreferrer">
|
|
68
|
+
<ListItemIcon sx={{ minWidth: "38px" }}><Icon sx={{ color: "#568bda" }}>article</Icon></ListItemIcon>
|
|
69
|
+
<ListItemText sx={{ color: "#568bda" }}>View Documentation</ListItemText>
|
|
70
|
+
</ListItemButton>
|
|
71
|
+
</ListItem>
|
|
72
|
+
</List>
|
|
73
|
+
{props?.relatedArticles?.length > 0 ? (
|
|
74
|
+
<Box sx={{ marginTop: 2 }}>
|
|
75
|
+
<Typography sx={{ color: "#568bda", textDecoration: "underline", textUnderlineOffset: 10, textDecorationThickness: 2, marginLeft: 2 }}>Features Tour</Typography>
|
|
76
|
+
<List sx={{ marginTop: 1.5 }}>
|
|
77
|
+
{props.relatedArticles.map((a) => {
|
|
78
|
+
const parts = a.split("/");
|
|
79
|
+
const lastPart = parts[parts.length - 1];
|
|
80
|
+
const result = lastPart.replace("-", " ");
|
|
81
|
+
return (
|
|
82
|
+
<ListItem disablePadding>
|
|
83
|
+
<ListItemButton href={supportHref + a} target="_blank" rel="noopener noreferrer">
|
|
84
|
+
<ListItemIcon sx={{ minWidth: "35px" }}><Icon sx={{ color: "#568bda" }}>play_circle</Icon></ListItemIcon>
|
|
85
|
+
<ListItemText><Typography sx={{ color: "#568bda", textTransform: "capitalize" }} fontSize="15px">{result}</Typography></ListItemText>
|
|
86
|
+
</ListItemButton>
|
|
87
|
+
</ListItem>
|
|
88
|
+
);
|
|
89
|
+
})}
|
|
90
|
+
</List>
|
|
91
|
+
</Box>
|
|
92
|
+
) : null}
|
|
93
|
+
</Box>
|
|
94
|
+
<Box sx={{ marginRight: 4, marginLeft: 4, marginTop: "auto" }}>
|
|
95
|
+
<hr style={{ color: "#568bda", borderColor: "#568bda", marginLeft: -13, marginRight: -13 }} />
|
|
96
|
+
<Box sx={{ display: "flex", alignItems: "center", justifyContent: "center", color: "#568bda", marginBottom: 1.5, marginTop: 1.5 }}>
|
|
97
|
+
<Avatar src="https://avatars.githubusercontent.com/u/74469593?s=200&v=4" variant="rounded" sx={{ width: 25, height: 25, marginRight: 1 }}>C</Avatar>
|
|
98
|
+
<Typography>ChurchApps</Typography>
|
|
99
|
+
</Box>
|
|
100
|
+
<Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center", gap: 4, marginBottom: 1 }}>
|
|
101
|
+
<Button variant="contained" size="small" startIcon={<Icon fontSize="small">mail</Icon>} fullWidth sx={{ backgroundColor: "#568bda" }}>Support</Button>
|
|
102
|
+
<Button variant="contained" size="small" startIcon={<Icon fontSize="small">forum</Icon>} fullWidth sx={{ backgroundColor: "#568bda" }} href="https://github.com/orgs/ChurchApps/discussions" target="_blank" rel="noopener noreferrer">Forum</Button>
|
|
103
|
+
</Box>
|
|
104
|
+
</Box>
|
|
105
|
+
</Box>
|
|
106
|
+
</Drawer>
|
|
107
|
+
</>
|
|
108
|
+
);
|
|
109
|
+
};
|