@churchapps/apphelper 0.3.7 → 0.3.9
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.
|
@@ -20,30 +20,30 @@ const SupportDrawer = (props) => {
|
|
|
20
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
21
|
};
|
|
22
22
|
const handleChurchSupportClick = () => {
|
|
23
|
-
if (validateEmail(supportContact
|
|
24
|
-
window.location.href = `mailto:${supportContact
|
|
23
|
+
if (validateEmail(supportContact)) {
|
|
24
|
+
window.location.href = `mailto:${supportContact}`;
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
window.open(`http://${supportContact
|
|
27
|
+
window.open(`http://${supportContact}`, "_blank").focus();
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const loadData = () => {
|
|
31
|
-
helpers_1.ApiHelper.get("/settings", "MembershipApi").then((data) => {
|
|
32
|
-
const contactRes = data
|
|
33
|
-
if (
|
|
34
|
-
setSupportContact(contactRes
|
|
35
|
-
const logoRes = data
|
|
36
|
-
if (
|
|
37
|
-
setChurchLogo(logoRes
|
|
31
|
+
helpers_1.ApiHelper.get("/settings/public/" + helpers_1.UserHelper.currentUserChurch.church.id, "MembershipApi").then((data) => {
|
|
32
|
+
const contactRes = data === null || data === void 0 ? void 0 : data.supportContact;
|
|
33
|
+
if (contactRes && contactRes !== "")
|
|
34
|
+
setSupportContact(contactRes);
|
|
35
|
+
const logoRes = data === null || data === void 0 ? void 0 : data.favicon_16x16;
|
|
36
|
+
if (logoRes && logoRes !== "")
|
|
37
|
+
setChurchLogo(logoRes);
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
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
|
|
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 : 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
42
|
const parts = a.split("/");
|
|
43
43
|
const lastPart = parts[parts.length - 1];
|
|
44
44
|
const result = lastPart.replace("-", " ");
|
|
45
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" })] })] })] }) })] }));
|
|
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" }, href: "mailto:support@livecs.org", 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
47
|
};
|
|
48
48
|
exports.SupportDrawer = SupportDrawer;
|
|
49
49
|
//# sourceMappingURL=SupportDrawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportDrawer.js","sourceRoot":"","sources":["../../../src/components/header/SupportDrawer.tsx"],"names":[],"mappings":";;;;AAAA,iCAAmD;AACnD,4CAAsJ;AACtJ,
|
|
1
|
+
{"version":3,"file":"SupportDrawer.js","sourceRoot":"","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,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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@churchapps/apphelper",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.09",
|
|
4
4
|
"description": "Library of helper functions for React and NextJS ChurchApps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-router-dom": "^6.15.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@churchapps/helpers": "^1.0.
|
|
40
|
+
"@churchapps/helpers": "^1.0.32",
|
|
41
41
|
"@emotion/cache": "^11.11.0",
|
|
42
42
|
"@emotion/react": "^11.11.1",
|
|
43
43
|
"@emotion/styled": "^11.11.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import { Avatar, Box, Button, Drawer, Icon, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Typography } from "@mui/material";
|
|
3
|
-
import { ApiHelper,
|
|
3
|
+
import { ApiHelper, UserHelper } from "../../helpers";
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
appName: string;
|
|
@@ -9,8 +9,8 @@ type Props = {
|
|
|
9
9
|
|
|
10
10
|
export const SupportDrawer = (props: Props) => {
|
|
11
11
|
const [open, setOpen] = useState<boolean>(false);
|
|
12
|
-
const [supportContact, setSupportContact] = useState<
|
|
13
|
-
const [churchLogo, setChurchLogo] = useState<
|
|
12
|
+
const [supportContact, setSupportContact] = useState<string>(null);
|
|
13
|
+
const [churchLogo, setChurchLogo] = useState<string>(null);
|
|
14
14
|
const supportHref = "https://support.churchapps.org/";
|
|
15
15
|
|
|
16
16
|
let currentAppName = "";
|
|
@@ -24,20 +24,20 @@ export const SupportDrawer = (props: Props) => {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const handleChurchSupportClick = () => {
|
|
27
|
-
if (validateEmail(supportContact
|
|
28
|
-
window.location.href = `mailto:${supportContact
|
|
27
|
+
if (validateEmail(supportContact)) {
|
|
28
|
+
window.location.href = `mailto:${supportContact}`;
|
|
29
29
|
} else {
|
|
30
|
-
window.open(`http://${supportContact
|
|
30
|
+
window.open(`http://${supportContact}`, "_blank").focus();
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const loadData = () => {
|
|
35
|
-
ApiHelper.get("/settings", "MembershipApi").then((data
|
|
36
|
-
const contactRes = data
|
|
37
|
-
if (contactRes
|
|
35
|
+
ApiHelper.get("/settings/public/" + UserHelper.currentUserChurch.church.id, "MembershipApi").then((data) => {
|
|
36
|
+
const contactRes = data?.supportContact;
|
|
37
|
+
if (contactRes && contactRes !== "") setSupportContact(contactRes);
|
|
38
38
|
|
|
39
|
-
const logoRes = data
|
|
40
|
-
if (logoRes
|
|
39
|
+
const logoRes = data?.favicon_16x16;
|
|
40
|
+
if (logoRes && logoRes !== "") setChurchLogo(logoRes);
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -55,7 +55,7 @@ export const SupportDrawer = (props: Props) => {
|
|
|
55
55
|
{supportContact ? (
|
|
56
56
|
<Box sx={{ display: "flex", justifyContent: "end", alignItems: "center" }}>
|
|
57
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
|
|
58
|
+
<Avatar variant="rounded" src={churchLogo ? churchLogo : null} sx={{ marginRight: 1, bgcolor: "#568bda", width: 25, height: 25 }}>
|
|
59
59
|
<Icon fontSize="small">church</Icon>
|
|
60
60
|
</Avatar>
|
|
61
61
|
<Typography sx={{ color: "#568bda", fontSize: "13px" }}>Support</Typography>
|
|
@@ -98,7 +98,7 @@ export const SupportDrawer = (props: Props) => {
|
|
|
98
98
|
<Typography>ChurchApps</Typography>
|
|
99
99
|
</Box>
|
|
100
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>
|
|
101
|
+
<Button variant="contained" size="small" startIcon={<Icon fontSize="small">mail</Icon>} fullWidth sx={{ backgroundColor: "#568bda" }} href="mailto:support@livecs.org">Support</Button>
|
|
102
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
103
|
</Box>
|
|
104
104
|
</Box>
|