@churchapps/apphelper 0.6.14 → 0.6.16
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/DisplayBox.d.ts +1 -1
- package/dist/components/DisplayBox.d.ts.map +1 -1
- package/dist/components/DisplayBox.js +2 -4
- package/dist/components/DisplayBox.js.map +1 -1
- package/dist/components/ErrorMessages.d.ts.map +1 -1
- package/dist/components/ErrorMessages.js +1 -1
- package/dist/components/ErrorMessages.js.map +1 -1
- package/dist/components/ExportLink.d.ts.map +1 -1
- package/dist/components/ExportLink.js +10 -10
- package/dist/components/ExportLink.js.map +1 -1
- package/dist/components/FloatingSupport.js.map +1 -1
- package/dist/components/FormCardPayment.d.ts.map +1 -1
- package/dist/components/FormCardPayment.js +20 -5
- package/dist/components/FormCardPayment.js.map +1 -1
- package/dist/components/FormSubmissionEdit.d.ts.map +1 -1
- package/dist/components/FormSubmissionEdit.js +8 -10
- package/dist/components/FormSubmissionEdit.js.map +1 -1
- package/dist/components/HelpIcon.d.ts.map +1 -1
- package/dist/components/HelpIcon.js.map +1 -1
- package/dist/components/ImageEditor.d.ts.map +1 -1
- package/dist/components/ImageEditor.js +10 -10
- package/dist/components/ImageEditor.js.map +1 -1
- package/dist/components/InputBox.d.ts +2 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +5 -7
- package/dist/components/InputBox.js.map +1 -1
- package/dist/components/Loading.d.ts.map +1 -1
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/PageHeader.js +14 -14
- package/dist/components/PersonAvatar.d.ts.map +1 -1
- package/dist/components/PersonAvatar.js +9 -16
- package/dist/components/PersonAvatar.js.map +1 -1
- package/dist/components/QuestionEdit.js +3 -3
- package/dist/components/QuestionEdit.js.map +1 -1
- package/dist/components/SmallButton.d.ts.map +1 -1
- package/dist/components/SmallButton.js +2 -1
- package/dist/components/SmallButton.js.map +1 -1
- package/dist/components/SupportModal.js.map +1 -1
- package/dist/components/gallery/GalleryModal.js +10 -10
- package/dist/components/gallery/GalleryModal.js.map +1 -1
- package/dist/components/gallery/StockPhotos.js +12 -12
- package/dist/components/gallery/StockPhotos.js.map +1 -1
- package/dist/components/header/Banner.d.ts.map +1 -1
- package/dist/components/header/Banner.js.map +1 -1
- package/dist/components/header/PrimaryMenu.js +4 -4
- package/dist/components/header/PrimaryMenu.js.map +1 -1
- package/dist/components/header/SecondaryMenu.d.ts.map +1 -1
- package/dist/components/header/SecondaryMenu.js.map +1 -1
- package/dist/components/header/SecondaryMenuAlt.d.ts.map +1 -1
- package/dist/components/header/SecondaryMenuAlt.js.map +1 -1
- package/dist/components/header/SiteHeader.d.ts.map +1 -1
- package/dist/components/header/SiteHeader.js +7 -7
- package/dist/components/header/SiteHeader.js.map +1 -1
- package/dist/components/header/SupportDrawer.js +1 -1
- package/dist/components/header/SupportDrawer.js.map +1 -1
- package/dist/components/notes/AddNote.js +14 -14
- package/dist/components/notes/Note.d.ts.map +1 -1
- package/dist/components/notes/Note.js +7 -7
- package/dist/components/notes/Note.js.map +1 -1
- package/dist/components/notes/Notes.d.ts.map +1 -1
- package/dist/components/notes/Notes.js +4 -4
- package/dist/components/notes/Notes.js.map +1 -1
- package/dist/components/wrapper/AppList.d.ts.map +1 -1
- package/dist/components/wrapper/AppList.js.map +1 -1
- package/dist/components/wrapper/ChurchList.js +5 -5
- package/dist/components/wrapper/ChurchList.js.map +1 -1
- package/dist/components/wrapper/NavItem.js +1 -1
- package/dist/components/wrapper/NavItem.js.map +1 -1
- package/dist/components/wrapper/NewPrivateMessage.d.ts.map +1 -1
- package/dist/components/wrapper/NewPrivateMessage.js +7 -6
- package/dist/components/wrapper/NewPrivateMessage.js.map +1 -1
- package/dist/components/wrapper/Notifications.d.ts.map +1 -1
- package/dist/components/wrapper/Notifications.js +12 -14
- package/dist/components/wrapper/Notifications.js.map +1 -1
- package/dist/components/wrapper/PrivateMessageDetails.js +10 -10
- package/dist/components/wrapper/PrivateMessages.d.ts.map +1 -1
- package/dist/components/wrapper/PrivateMessages.js +119 -123
- package/dist/components/wrapper/PrivateMessages.js.map +1 -1
- package/dist/components/wrapper/UserMenu.d.ts.map +1 -1
- package/dist/components/wrapper/UserMenu.js +15 -15
- package/dist/components/wrapper/UserMenu.js.map +1 -1
- package/dist/helpers/AnalyticsHelper.d.ts.map +1 -1
- package/dist/helpers/AnalyticsHelper.js +3 -3
- package/dist/helpers/AnalyticsHelper.js.map +1 -1
- package/dist/helpers/ArrayHelper.d.ts.map +1 -1
- package/dist/helpers/ArrayHelper.js.map +1 -1
- package/dist/helpers/CurrencyHelper.d.ts +4 -0
- package/dist/helpers/CurrencyHelper.d.ts.map +1 -1
- package/dist/helpers/CurrencyHelper.js +65 -0
- package/dist/helpers/CurrencyHelper.js.map +1 -1
- package/dist/helpers/ErrorHelper.d.ts.map +1 -1
- package/dist/helpers/ErrorHelper.js.map +1 -1
- package/dist/helpers/EventHelper.d.ts.map +1 -1
- package/dist/helpers/EventHelper.js +1 -1
- package/dist/helpers/EventHelper.js.map +1 -1
- package/dist/helpers/FileHelper.d.ts.map +1 -1
- package/dist/helpers/FileHelper.js +3 -1
- package/dist/helpers/FileHelper.js.map +1 -1
- package/dist/helpers/Locale.d.ts.map +1 -1
- package/dist/helpers/Locale.js +10 -16
- package/dist/helpers/Locale.js.map +1 -1
- package/dist/helpers/NotificationService.js +4 -4
- package/dist/helpers/PersonHelper.d.ts.map +1 -1
- package/dist/helpers/PersonHelper.js +5 -4
- package/dist/helpers/PersonHelper.js.map +1 -1
- package/dist/helpers/SlugHelper.d.ts.map +1 -1
- package/dist/helpers/SlugHelper.js +5 -3
- package/dist/helpers/SlugHelper.js.map +1 -1
- package/dist/helpers/SocketHelper.d.ts.map +1 -1
- package/dist/helpers/SocketHelper.js +5 -10
- package/dist/helpers/SocketHelper.js.map +1 -1
- package/dist/helpers/UniqueIdHelper.d.ts.map +1 -1
- package/dist/helpers/UniqueIdHelper.js +132 -7
- package/dist/helpers/UniqueIdHelper.js.map +1 -1
- package/dist/helpers/UserHelper.d.ts.map +1 -1
- package/dist/helpers/UserHelper.js +2 -2
- package/dist/helpers/UserHelper.js.map +1 -1
- package/dist/hooks/useMountedState.d.ts.map +1 -1
- package/dist/hooks/useMountedState.js +1 -1
- package/dist/hooks/useMountedState.js.map +1 -1
- package/dist/hooks/useNotifications.d.ts +2 -2
- package/dist/hooks/useNotifications.js +5 -5
- package/dist/public/locales/de.json +15 -7
- package/dist/public/locales/es.json +193 -190
- package/dist/public/locales/fr.json +15 -7
- package/dist/public/locales/hi.json +15 -7
- package/dist/public/locales/it.json +15 -7
- package/dist/public/locales/ko.json +15 -7
- package/dist/public/locales/no.json +15 -7
- package/dist/public/locales/pt.json +15 -7
- package/dist/public/locales/ru.json +15 -7
- package/dist/public/locales/tl.json +15 -7
- package/dist/public/locales/zh.json +15 -7
- package/package.json +106 -73
- package/dist/helpers/DateHelper.d.ts +0 -18
- package/dist/helpers/DateHelper.d.ts.map +0 -1
- package/dist/helpers/DateHelper.js +0 -102
- package/dist/helpers/DateHelper.js.map +0 -1
- package/public/css/cropper.css +0 -309
- package/public/css/styles.css +0 -112
- package/public/locales/de.json +0 -273
- package/public/locales/en.json +0 -281
- package/public/locales/es.json +0 -278
- package/public/locales/fr.json +0 -273
- package/public/locales/hi.json +0 -273
- package/public/locales/it.json +0 -273
- package/public/locales/ko.json +0 -273
- package/public/locales/no.json +0 -273
- package/public/locales/pt.json +0 -273
- package/public/locales/ru.json +0 -273
- package/public/locales/tl.json +0 -273
- package/public/locales/zh.json +0 -273
- package/src/components/DisplayBox.tsx +0 -83
- package/src/components/ErrorMessages.tsx +0 -28
- package/src/components/ExportLink.tsx +0 -81
- package/src/components/FloatingSupport.tsx +0 -18
- package/src/components/FormCardPayment.tsx +0 -184
- package/src/components/FormSubmissionEdit.tsx +0 -168
- package/src/components/HelpIcon.tsx +0 -12
- package/src/components/ImageEditor.tsx +0 -167
- package/src/components/InputBox.tsx +0 -96
- package/src/components/Loading.tsx +0 -31
- package/src/components/PageHeader.tsx +0 -111
- package/src/components/PersonAvatar.tsx +0 -78
- package/src/components/QuestionEdit.tsx +0 -99
- package/src/components/SmallButton.tsx +0 -42
- package/src/components/SupportModal.tsx +0 -32
- package/src/components/TabPanel.tsx +0 -28
- package/src/components/gallery/GalleryModal.tsx +0 -170
- package/src/components/gallery/StockPhotos.tsx +0 -96
- package/src/components/gallery/index.ts +0 -2
- package/src/components/header/Banner.tsx +0 -11
- package/src/components/header/PrimaryMenu.tsx +0 -101
- package/src/components/header/SecondaryMenu.tsx +0 -23
- package/src/components/header/SecondaryMenuAlt.tsx +0 -40
- package/src/components/header/SiteHeader.tsx +0 -205
- package/src/components/header/SupportDrawer.tsx +0 -112
- package/src/components/header/index.tsx +0 -2
- package/src/components/index.tsx +0 -20
- package/src/components/notes/AddNote.tsx +0 -185
- package/src/components/notes/Note.tsx +0 -84
- package/src/components/notes/Notes.tsx +0 -208
- package/src/components/notes/index.ts +0 -3
- package/src/components/wrapper/AppList.tsx +0 -18
- package/src/components/wrapper/ChurchList.tsx +0 -145
- package/src/components/wrapper/NavItem.tsx +0 -47
- package/src/components/wrapper/NewPrivateMessage.tsx +0 -249
- package/src/components/wrapper/Notifications.tsx +0 -220
- package/src/components/wrapper/PrivateMessageDetails.tsx +0 -106
- package/src/components/wrapper/PrivateMessages.tsx +0 -574
- package/src/components/wrapper/UserMenu.tsx +0 -384
- package/src/components/wrapper/index.tsx +0 -8
- package/src/helpers/AnalyticsHelper.ts +0 -44
- package/src/helpers/AppearanceHelper.ts +0 -73
- package/src/helpers/ArrayHelper.ts +0 -87
- package/src/helpers/CurrencyHelper.ts +0 -10
- package/src/helpers/DateHelper.ts +0 -104
- package/src/helpers/ErrorHelper.ts +0 -41
- package/src/helpers/EventHelper.ts +0 -49
- package/src/helpers/FileHelper.ts +0 -31
- package/src/helpers/Locale.ts +0 -457
- package/src/helpers/NotificationService.ts +0 -233
- package/src/helpers/PersonHelper.ts +0 -62
- package/src/helpers/SlugHelper.ts +0 -27
- package/src/helpers/SocketHelper.ts +0 -183
- package/src/helpers/UniqueIdHelper.ts +0 -36
- package/src/helpers/UserHelper.ts +0 -103
- package/src/helpers/createEmotionCache.ts +0 -17
- package/src/helpers/index.ts +0 -58
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useMountedState.ts +0 -18
- package/src/hooks/useNotifications.ts +0 -95
- package/src/index.ts +0 -3
- package/src/types/interface-extensions.d.ts +0 -12
- package/tsconfig.json +0 -32
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Paper, Box, Typography, Stack, Button, PaperProps } from "@mui/material";
|
|
5
|
-
import { Icon } from "@mui/material";
|
|
6
|
-
import { HelpIcon } from "./HelpIcon";
|
|
7
|
-
import { Locale } from "../helpers";
|
|
8
|
-
import { styled, useTheme } from '@mui/material/styles';
|
|
9
|
-
|
|
10
|
-
declare module '@mui/material/styles' {
|
|
11
|
-
interface Palette {
|
|
12
|
-
InputBox: { headerText: string; };
|
|
13
|
-
}
|
|
14
|
-
interface PaletteOptions {
|
|
15
|
-
InputBox?: { headerText?: string; };
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
interface Props {
|
|
21
|
-
id?: string;
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
headerIcon?: string;
|
|
24
|
-
headerText?: string;
|
|
25
|
-
help?: string;
|
|
26
|
-
saveText?: string;
|
|
27
|
-
deleteText?: string;
|
|
28
|
-
cancelText?: string;
|
|
29
|
-
headerActionContent?: React.ReactNode;
|
|
30
|
-
cancelFunction?: () => void;
|
|
31
|
-
deleteFunction?: () => void;
|
|
32
|
-
saveFunction?: () => void;
|
|
33
|
-
"data-testid"?: string;
|
|
34
|
-
className?: string;
|
|
35
|
-
isSubmitting?: boolean;
|
|
36
|
-
ariaLabelDelete?: string;
|
|
37
|
-
ariaLabelSave?: string;
|
|
38
|
-
saveButtonType?: "submit" | "button";
|
|
39
|
-
mainContainerCssProps?: PaperProps;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const CustomContextBox = styled(Box)({
|
|
43
|
-
name: "InputBox",
|
|
44
|
-
slot: "root",
|
|
45
|
-
marginTop: 10,
|
|
46
|
-
overflowX: "hidden",
|
|
47
|
-
"& p": { color: "#666" },
|
|
48
|
-
"& label": { color: "#999" },
|
|
49
|
-
"& ul": { paddingLeft: 15 },
|
|
50
|
-
"& li": {
|
|
51
|
-
marginBottom: 10,
|
|
52
|
-
"& i": { marginRight: 5 }
|
|
53
|
-
},
|
|
54
|
-
"& td": {
|
|
55
|
-
"& i": { marginRight: 5 }
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export function InputBox({ mainContainerCssProps = {}, ...props }: Props) {
|
|
61
|
-
const theme = useTheme();
|
|
62
|
-
const headerText = theme?.palette?.InputBox?.headerText ? theme?.palette?.InputBox?.headerText : "primary";
|
|
63
|
-
|
|
64
|
-
let buttons = [];
|
|
65
|
-
if (props.cancelFunction) buttons.push(<Button key="cancel" onClick={props.cancelFunction} color="warning" sx={{ "&:focus": { outline: "none" } }}>{props.cancelText || Locale.label("common.cancel")}</Button>);
|
|
66
|
-
if (props.deleteFunction) buttons.push(<Button key="delete" id="delete" variant="outlined" aria-label={props.ariaLabelDelete} onClick={props.deleteFunction} color="error" sx={{ "&:focus": { outline: "none" } }}>{props.deleteText || Locale.label("common.delete")}</Button>);
|
|
67
|
-
if (props.saveFunction) buttons.push(<Button key="save" type={props.saveButtonType || "button"} variant="contained" disableElevation aria-label={props.ariaLabelSave} onClick={props.saveFunction} disabled={props.isSubmitting} sx={{ "&:focus": { outline: "none" } }}>{props.saveText || Locale.label("common.save")}</Button>);
|
|
68
|
-
|
|
69
|
-
let classNames = ["inputBox"];
|
|
70
|
-
if (props.className) {
|
|
71
|
-
classNames.push(props.className);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<Paper id={props.id || "input-box"} sx={{ padding: 2, marginBottom: 4 }} data-testid={props["data-testid"]} {...mainContainerCssProps}>
|
|
76
|
-
{props.help && <HelpIcon article={props.help} />}
|
|
77
|
-
<Box id="input-box-header" sx={{ display: "flex", justifyContent: "space-between", alignItems: "center", position: "relative" }} data-testid="input-box-header">
|
|
78
|
-
<Box id="input-box-title-section" display="flex" alignItems="center">
|
|
79
|
-
{props.headerIcon && <Icon id="input-box-icon" sx={{ color: headerText }}>{props.headerIcon}</Icon>}
|
|
80
|
-
{props.headerText && (
|
|
81
|
-
<Typography id="input-box-title" component="h2" sx={{ display: "inline-block", marginLeft: props.headerIcon ? 1 : 0 }} variant="h6" color={headerText}>
|
|
82
|
-
{props.headerText}
|
|
83
|
-
</Typography>
|
|
84
|
-
)}
|
|
85
|
-
</Box>
|
|
86
|
-
<Box id="input-box-actions">
|
|
87
|
-
{props.headerActionContent}
|
|
88
|
-
</Box>
|
|
89
|
-
</Box>
|
|
90
|
-
<CustomContextBox id="input-box-content">{props.children}</CustomContextBox>
|
|
91
|
-
<Stack id="input-box-buttons" direction="row" sx={{ marginTop: 1 }} spacing={1} justifyContent="end">
|
|
92
|
-
{buttons}
|
|
93
|
-
</Stack>
|
|
94
|
-
</Paper>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Dots } from "react-activity";
|
|
5
|
-
import "react-activity/dist/Dots.css";
|
|
6
|
-
|
|
7
|
-
interface Props { size?: "sm" | "md" | "lg", loadingText?: string, color?: string }
|
|
8
|
-
|
|
9
|
-
export const Loading: React.FC<Props> = (props) => {
|
|
10
|
-
|
|
11
|
-
const getContents = () => {
|
|
12
|
-
const text = (props.loadingText) ? props.loadingText : "Loading"
|
|
13
|
-
const color = (props.color) ? props.color : "#222"
|
|
14
|
-
let result = <><Dots speed={0.8} animating={true} size={32} color={color} /><p style={{ color: color }}>{text}</p></>
|
|
15
|
-
switch (props.size) {
|
|
16
|
-
case "sm":
|
|
17
|
-
result = <><Dots speed={0.8} animating={true} size={20} color={color} /><p style={{ fontSize: 12, color: color }}>{text}</p></>
|
|
18
|
-
break;
|
|
19
|
-
case "lg":
|
|
20
|
-
result = <><Dots speed={0.8} animating={true} size={48} color={color} /><p style={{ fontSize: 30, color: color }}>{text}</p></>
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div id="loading-component" style={{ textAlign: "center", fontFamily: "Roboto" }}>
|
|
28
|
-
{getContents()}
|
|
29
|
-
</div>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { Box, Typography, Stack } from "@mui/material";
|
|
3
|
-
|
|
4
|
-
interface PageHeaderProps {
|
|
5
|
-
icon: ReactNode;
|
|
6
|
-
title: string;
|
|
7
|
-
subtitle?: string;
|
|
8
|
-
children?: ReactNode; // For action buttons or tabs
|
|
9
|
-
statistics?: Array<{ icon: ReactNode; value: string; label: string }>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const PageHeader: React.FC<PageHeaderProps> = ({ icon, title, subtitle, children, statistics }) => {
|
|
13
|
-
return (
|
|
14
|
-
<Box id="page-header" sx={{
|
|
15
|
-
backgroundColor: "var(--c1l2)",
|
|
16
|
-
color: "#FFF",
|
|
17
|
-
position: 'relative',
|
|
18
|
-
left: '50%',
|
|
19
|
-
right: '50%',
|
|
20
|
-
marginLeft: '-50vw',
|
|
21
|
-
marginRight: '-50vw',
|
|
22
|
-
width: '100vw',
|
|
23
|
-
'--c1': '#1565C0',
|
|
24
|
-
'--c1d1': '#1358AD',
|
|
25
|
-
'--c1d2': '#114A99',
|
|
26
|
-
'--c1l2': '#568BDA'
|
|
27
|
-
}}>
|
|
28
|
-
<Box sx={{
|
|
29
|
-
paddingX: { xs: 2, sm: 3, md: 4 },
|
|
30
|
-
paddingY: 3
|
|
31
|
-
}}>
|
|
32
|
-
<Stack direction={{ xs: "column", md: "row" }} spacing={{ xs: 2, md: 4 }} alignItems={{ xs: "flex-start", md: "center" }} sx={{ width: "100%" }}>
|
|
33
|
-
{/* Left side: Title and Icon */}
|
|
34
|
-
<Stack id="page-header-title-section" direction="row" spacing={2} alignItems="center" sx={{ flex: 1 }}>
|
|
35
|
-
<Box
|
|
36
|
-
id="page-header-icon"
|
|
37
|
-
sx={{
|
|
38
|
-
backgroundColor: "rgba(255,255,255,0.2)",
|
|
39
|
-
borderRadius: "12px",
|
|
40
|
-
p: 1.5,
|
|
41
|
-
display: "flex",
|
|
42
|
-
alignItems: "center",
|
|
43
|
-
justifyContent: "center",
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
{React.cloneElement(icon as React.ReactElement<any>, { sx: { fontSize: 32, color: "#FFF" } })}
|
|
47
|
-
</Box>
|
|
48
|
-
<Box id="page-header-text">
|
|
49
|
-
<Typography
|
|
50
|
-
id="page-header-title"
|
|
51
|
-
variant="h4"
|
|
52
|
-
sx={{
|
|
53
|
-
fontWeight: 600,
|
|
54
|
-
mb: 0.5,
|
|
55
|
-
fontSize: { xs: "1.75rem", md: "2.125rem" },
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
{title}
|
|
59
|
-
</Typography>
|
|
60
|
-
{subtitle && (
|
|
61
|
-
<Typography
|
|
62
|
-
id="page-header-subtitle"
|
|
63
|
-
variant="body1"
|
|
64
|
-
sx={{
|
|
65
|
-
color: "rgba(255,255,255,0.9)",
|
|
66
|
-
fontSize: { xs: "0.875rem", md: "1rem" },
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
{subtitle}
|
|
70
|
-
</Typography>
|
|
71
|
-
)}
|
|
72
|
-
</Box>
|
|
73
|
-
</Stack>
|
|
74
|
-
|
|
75
|
-
{/* Right side: Action Buttons/Tabs */}
|
|
76
|
-
{children && (
|
|
77
|
-
<Stack
|
|
78
|
-
id="page-header-actions"
|
|
79
|
-
direction="row"
|
|
80
|
-
spacing={1}
|
|
81
|
-
sx={{
|
|
82
|
-
flexShrink: 0,
|
|
83
|
-
justifyContent: { xs: "flex-start", md: "flex-end" },
|
|
84
|
-
width: { xs: "100%", md: "auto" },
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
{children}
|
|
88
|
-
</Stack>
|
|
89
|
-
)}
|
|
90
|
-
</Stack>
|
|
91
|
-
|
|
92
|
-
{/* Statistics row */}
|
|
93
|
-
{statistics && statistics.length > 0 && (
|
|
94
|
-
<Stack id="page-header-statistics" direction={{ xs: "column", sm: "row" }} spacing={3} sx={{ mt: 3 }}>
|
|
95
|
-
{statistics.map((stat) => (
|
|
96
|
-
<Stack key={stat.label} direction="row" spacing={1} alignItems="center">
|
|
97
|
-
{React.cloneElement(stat.icon as React.ReactElement<any>, { sx: { color: "#FFF", fontSize: 20 } })}
|
|
98
|
-
<Typography variant="h6" sx={{ color: "#FFF", fontWeight: 600, mr: 1 }}>
|
|
99
|
-
{stat.value}
|
|
100
|
-
</Typography>
|
|
101
|
-
<Typography variant="body2" sx={{ color: "rgba(255,255,255,0.9)", fontSize: "0.875rem" }}>
|
|
102
|
-
{stat.label}
|
|
103
|
-
</Typography>
|
|
104
|
-
</Stack>
|
|
105
|
-
))}
|
|
106
|
-
</Stack>
|
|
107
|
-
)}
|
|
108
|
-
</Box>
|
|
109
|
-
</Box>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Avatar, SxProps } from "@mui/material";
|
|
5
|
-
import { PersonInterface } from "@churchapps/helpers";
|
|
6
|
-
import { PersonHelper } from "../helpers";
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
person: PersonInterface;
|
|
10
|
-
size?: "small" | "medium" | "large" | "xlarge" | "xxlarge" | "responsive";
|
|
11
|
-
sx?: SxProps;
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const PersonAvatar: React.FC<Props> = ({ person, size = "medium", sx, onClick }) => {
|
|
16
|
-
const [imageError, setImageError] = React.useState(false);
|
|
17
|
-
|
|
18
|
-
const getSizeProps = () => {
|
|
19
|
-
switch (size) {
|
|
20
|
-
case "small":
|
|
21
|
-
return { width: 48, height: 48 };
|
|
22
|
-
case "medium":
|
|
23
|
-
return { width: 56, height: 56 };
|
|
24
|
-
case "large":
|
|
25
|
-
return { width: 80, height: 80 };
|
|
26
|
-
case "xlarge":
|
|
27
|
-
return { width: 100, height: 100 };
|
|
28
|
-
case "xxlarge":
|
|
29
|
-
return { width: 120, height: 120 };
|
|
30
|
-
case "responsive":
|
|
31
|
-
return { width: { xs: 70, sm: 80, md: 100 }, height: { xs: 70, sm: 80, md: 100 } };
|
|
32
|
-
default:
|
|
33
|
-
return { width: 56, height: 56 };
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const getInitials = () => {
|
|
38
|
-
if (!person?.name?.display) return "?";
|
|
39
|
-
|
|
40
|
-
const names = person.name.display.trim().split(" ");
|
|
41
|
-
if (names.length >= 2) {
|
|
42
|
-
return (names[0][0] + names[names.length - 1][0]).toUpperCase();
|
|
43
|
-
} else if (names.length === 1) {
|
|
44
|
-
return names[0][0]?.toUpperCase() || "?";
|
|
45
|
-
}
|
|
46
|
-
return "?";
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const photoUrl = PersonHelper.getPhotoUrl(person);
|
|
50
|
-
const sizeProps = getSizeProps();
|
|
51
|
-
|
|
52
|
-
// Combine default styles with custom sx
|
|
53
|
-
const combinedSx = {
|
|
54
|
-
...sizeProps,
|
|
55
|
-
cursor: onClick ? "pointer" : "default",
|
|
56
|
-
"&:hover": onClick ? {
|
|
57
|
-
opacity: 0.8,
|
|
58
|
-
transition: "opacity 0.2s ease-in-out",
|
|
59
|
-
} : {},
|
|
60
|
-
...sx,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const handleImageError = () => {
|
|
64
|
-
setImageError(true);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<Avatar
|
|
69
|
-
src={!imageError ? photoUrl : undefined}
|
|
70
|
-
alt={person?.name?.display || "User avatar"}
|
|
71
|
-
sx={combinedSx}
|
|
72
|
-
onClick={onClick}
|
|
73
|
-
onError={handleImageError}
|
|
74
|
-
>
|
|
75
|
-
{(imageError || !photoUrl) && getInitials()}
|
|
76
|
-
</Avatar>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Elements } from "@stripe/react-stripe-js";
|
|
5
|
-
import { Stripe } from "@stripe/stripe-js";
|
|
6
|
-
import { MuiTelInput } from "mui-tel-input";
|
|
7
|
-
import { AnswerInterface, QuestionInterface } from "@churchapps/helpers";
|
|
8
|
-
import { Checkbox, Select, MenuItem, SelectChangeEvent, FormControl, InputLabel, TextField, FormLabel, FormGroup, FormControlLabel, Box } from "@mui/material";
|
|
9
|
-
import { FormCardPayment } from "./FormCardPayment";
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
answer: AnswerInterface
|
|
13
|
-
question: QuestionInterface,
|
|
14
|
-
noBackground?: boolean,
|
|
15
|
-
changeFunction: (questionId: string, value: string) => void,
|
|
16
|
-
churchId?: string,
|
|
17
|
-
ref?: React.ForwardedRef<any>,
|
|
18
|
-
stripePromise?: Promise<Stripe>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const QuestionEdit = React.forwardRef<any, Props>(({noBackground = false, ...props}, ref) => {
|
|
22
|
-
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement> | SelectChangeEvent<string>) => {
|
|
23
|
-
props.changeFunction(props.question.id, e.target.value);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const handleCheck = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
27
|
-
const selectedOptions = props.answer.value ? props.answer.value.split(",") : [];
|
|
28
|
-
if (e.target.checked) {
|
|
29
|
-
selectedOptions.push(e.target.name);
|
|
30
|
-
} else {
|
|
31
|
-
const idx = selectedOptions.indexOf(e.target.name);
|
|
32
|
-
selectedOptions.splice(idx, 1);
|
|
33
|
-
}
|
|
34
|
-
props.changeFunction(props.question.id, selectedOptions.join());
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let q = props.question;
|
|
38
|
-
|
|
39
|
-
if (q.fieldType === "Heading") return <h5>{q.title}</h5>;
|
|
40
|
-
else {
|
|
41
|
-
let input = null;
|
|
42
|
-
let choiceOptions = [];
|
|
43
|
-
if (q.choices !== undefined && q.choices !== null) {
|
|
44
|
-
if (q.fieldType === "Multiple Choice") {
|
|
45
|
-
for (let i = 0; i < q.choices.length; i++) choiceOptions.push(<MenuItem key={q.choices[i].value} value={q.choices[i].value}>{q.choices[i].text}</MenuItem>);
|
|
46
|
-
} else if (q.fieldType === "Checkbox") {
|
|
47
|
-
for (let i = 0; i < q.choices.length; i++) choiceOptions.push(<FormControlLabel key={q.choices[i].value} label={q.choices[i].text} control={<Checkbox onChange={handleCheck} name={q.choices[i].value} />} />);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let answerValue = (props.answer === null) ? "" : props.answer.value
|
|
52
|
-
switch (q.fieldType) {
|
|
53
|
-
case "Textbox": input = <TextField fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}} InputLabelProps={{ sx: { fontWeight: "bold" } }} label={q.title} placeholder={q.placeholder} value={answerValue} onChange={handleChange} />; break;
|
|
54
|
-
case "Multiple Choice": {
|
|
55
|
-
input = (
|
|
56
|
-
<FormControl fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}}>
|
|
57
|
-
<InputLabel sx={{ fontWeight: "bold" }}>{q.title}</InputLabel>
|
|
58
|
-
<Select fullWidth label={q.title} value={answerValue} onChange={handleChange}>{choiceOptions}</Select>
|
|
59
|
-
</FormControl>);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
case "Yes/No": {
|
|
63
|
-
input = (
|
|
64
|
-
<FormControl fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}}>
|
|
65
|
-
<InputLabel sx={{ fontWeight: "bold" }}>{q.title}</InputLabel>
|
|
66
|
-
<Select fullWidth label={q.title} value={answerValue} onChange={handleChange}>
|
|
67
|
-
<MenuItem value="False">No</MenuItem>
|
|
68
|
-
<MenuItem value="True">Yes</MenuItem>
|
|
69
|
-
</Select>
|
|
70
|
-
</FormControl>);
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
case "Checkbox": {
|
|
74
|
-
input = (
|
|
75
|
-
<FormControl fullWidth sx={{ marginLeft: 1 }}>
|
|
76
|
-
<FormLabel sx={{ fontWeight: "bold" }}>{q.title}</FormLabel>
|
|
77
|
-
<FormGroup>
|
|
78
|
-
{choiceOptions}
|
|
79
|
-
</FormGroup>
|
|
80
|
-
</FormControl>
|
|
81
|
-
);
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
case "Whole Number":
|
|
85
|
-
case "Decimal":
|
|
86
|
-
input = <TextField fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}} type="number" InputLabelProps={{ shrink: true, sx: { fontWeight: "bold" } }} label={q.title} placeholder={q.placeholder} value={answerValue} onChange={handleChange} />;
|
|
87
|
-
break;
|
|
88
|
-
case "Date": input = <TextField fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}} type="date" InputLabelProps={{ shrink: true, sx: { fontWeight: "bold" } }} label={q.title} placeholder={q.placeholder} value={answerValue} onChange={handleChange} />; break;
|
|
89
|
-
case "Phone Number": input = <MuiTelInput fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}} InputLabelProps={{ sx: { fontWeight: "bold" } }} label={q.title} placeholder="" value={answerValue} onChange={(value) => { props.changeFunction(props.question.id, value); }} defaultCountry="US" focusOnSelectCountry excludedCountries={["TA", "AC"]} />; break;
|
|
90
|
-
case "Email": input = <TextField fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}} type="email" InputLabelProps={{ sx: { fontWeight: "bold" } }} label={q.title} placeholder="john@doe.com" value={answerValue} onChange={handleChange} />; break;
|
|
91
|
-
case "Text Area": input = <TextField fullWidth style={noBackground ? {backgroundColor: "white", borderRadius: "4px"} : {}} multiline rows={4} InputLabelProps={{ sx: { fontWeight: "bold" } }} label={q.title} placeholder={q.placeholder} value={answerValue} onChange={handleChange} />; break;
|
|
92
|
-
case "Payment": input = <Elements stripe={props.stripePromise}><FormCardPayment churchId={props.churchId} question={q} ref={ref} /></Elements>; break;
|
|
93
|
-
default: return null;
|
|
94
|
-
}
|
|
95
|
-
return input;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Button, Icon, Tooltip } from "@mui/material";
|
|
5
|
-
import { Navigate } from "react-router-dom";
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
ariaLabel?: string;
|
|
9
|
-
text?: string;
|
|
10
|
-
icon: string;
|
|
11
|
-
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
12
|
-
toolTip?: string;
|
|
13
|
-
onClick?: (e: React.MouseEvent) => void;
|
|
14
|
-
href?: string;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
"data-testid"?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const SmallButton = React.forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|
20
|
-
const [redirectUrl, setRedirectUrl] = React.useState("");
|
|
21
|
-
|
|
22
|
-
const handleClick = (e: React.MouseEvent) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
if (props.href) setRedirectUrl(props.href);
|
|
25
|
-
else if (props.onClick) props.onClick(e);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const style = (props.text)
|
|
29
|
-
? { backgroundColor: props.color, "& span": { marginRight: 1 } }
|
|
30
|
-
: { minWidth: "auto", padding: "4px 4px" }
|
|
31
|
-
|
|
32
|
-
if (redirectUrl) return <Navigate to={redirectUrl} />
|
|
33
|
-
else return (
|
|
34
|
-
<Tooltip title={props.toolTip || ""} arrow placement="top">
|
|
35
|
-
<Button sx={style} disabled={props.disabled} variant={props.text ? "outlined" : "text"} color={props.color} aria-label={props.ariaLabel || "editButton"} onClick={handleClick} size="small" data-testid={props["data-testid"] || `small-button-${props.icon}`}>
|
|
36
|
-
<Icon>{props.icon}</Icon>{(props.text) ? props.text : ""}
|
|
37
|
-
</Button>
|
|
38
|
-
</Tooltip>
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
SmallButton.displayName = "SmallButton";
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Icon, Stack } from "@mui/material";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Locale } from "../helpers";
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
appName?: string
|
|
9
|
-
onClose: () => void
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const SupportModal: React.FC<Props> = ({ appName = "", onClose }) => {
|
|
13
|
-
const subject = appName ? `?subject=${appName} Support` : ""
|
|
14
|
-
|
|
15
|
-
return (<>
|
|
16
|
-
<Dialog
|
|
17
|
-
open={true}
|
|
18
|
-
onClose={onClose}
|
|
19
|
-
aria-labelledby="support-modal-title"
|
|
20
|
-
aria-describedby="support-modal-content"
|
|
21
|
-
>
|
|
22
|
-
<DialogTitle id="support-modal-title">Get Support</DialogTitle>
|
|
23
|
-
<DialogContent id="support-modal-content">
|
|
24
|
-
<Stack direction="row" alignItems="center" sx={{flexWrap: "wrap"}}><b><Stack direction="row" alignItems="center" mr="5px"><Icon sx={{marginRight: "5px"}}>info</Icon> {Locale.label("support.documentation")}:</Stack></b> <a href="https://support.churchapps.org" target="_new">https://support.churchapps.org</a></Stack>
|
|
25
|
-
<Stack direction="row" alignItems="center" sx={{flexWrap: "wrap"}} mb={2}><b><Stack direction="row" alignItems="center" mr="5px"><Icon sx={{marginRight: "5px"}}>forum</Icon> {Locale.label("support.discussions")}:</Stack></b> <a href="https://github.com/orgs/ChurchApps/discussions" target="_new">https://github.com/orgs/ChurchApps/discussions</a></Stack>
|
|
26
|
-
</DialogContent>
|
|
27
|
-
<DialogActions sx={{ paddingX: "16px", paddingBottom: "12px" }}>
|
|
28
|
-
<Button variant="outlined" onClick={onClose}>Close</Button>
|
|
29
|
-
</DialogActions>
|
|
30
|
-
</Dialog>
|
|
31
|
-
</>);
|
|
32
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box } from "@mui/material";
|
|
3
|
-
|
|
4
|
-
interface TabPanelProps {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
index: number;
|
|
7
|
-
value: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function TabPanel(props: TabPanelProps) {
|
|
11
|
-
const { children, value, index, ...other } = props;
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div
|
|
15
|
-
role="tabpanel"
|
|
16
|
-
hidden={value !== index}
|
|
17
|
-
id={`simple-tabpanel-${index}`}
|
|
18
|
-
aria-labelledby={`simple-tab-${index}`}
|
|
19
|
-
{...other}
|
|
20
|
-
>
|
|
21
|
-
{value === index && (
|
|
22
|
-
<Box sx={{ p: 3 }}>
|
|
23
|
-
{children}
|
|
24
|
-
</Box>
|
|
25
|
-
)}
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|