diff --git a/src/app/[sdSlug]/my/[pageSlug]/components/TabsClient.tsx b/src/app/[sdSlug]/my/[pageSlug]/components/TabsClient.tsx
index 2003900d..6ac9ec84 100644
--- a/src/app/[sdSlug]/my/[pageSlug]/components/TabsClient.tsx
+++ b/src/app/[sdSlug]/my/[pageSlug]/components/TabsClient.tsx
@@ -4,6 +4,7 @@ import React, { useEffect } from "react";
import { UserHelper } from "@churchapps/apphelper";
import { ApiHelper } from "@churchapps/apphelper";
+import { Permissions } from "@churchapps/helpers";
import { PersonHelper } from "@/helpers"
import UserContext from "@/context/UserContext";
import Link from "next/link";
@@ -36,7 +37,8 @@ export const TabsClient = (props: Props) => {
showPlans = false,
showDirectory = memberStatus === "member" || memberStatus === "staff",
showLessons = classRoooms.length > 0,
- showCheckin = campuses.length > 0;
+ showCheckin = campuses.length > 0,
+ showAdmin = UserHelper.checkAccess(Permissions.membershipApi.people.view);
if (context.userChurch) {
showMyGroups = context.userChurch?.groups?.length > 0;
@@ -52,15 +54,14 @@ export const TabsClient = (props: Props) => {
if (showCheckin) tabs.push({url:"/my/checkin", label:"Check-in"});
if (showLessons) tabs.push({url:"/my/lessons", label:"Lessons"});
if (showDonations) tabs.push({url:"/my/donate", label:"Donations"});
+ if (showAdmin) tabs.push({url:`https://admin.b1.church/login?jwt=${context.userChurch.jwt}&churchId=${context.userChurch.church.id}&returnUrl=/`, label:"Admin"});
return tabs;
}
useEffect(() => { loadData() }, [context.userChurch])
- const getItem = (tab:any) =>
- //if (tab.key === selectedTab) return (
{ e.preventDefault(); setSelectedTab(tab.key); }}>{tab.icon} {tab.label})
- ({tab.label})
+ const getItem = (tab:any) => ({tab.label})
return
{getTabs().map((tab, index) => getItem(tab))}
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index 895f9b33..0c2ab963 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -50,6 +50,7 @@ export function Header(props: Props) {
const [open, setOpen] = useState(false);
const [menuAnchor, setMenuAnchor] = useState(null);
const [showLogin, setShowLogin] = useState(false);
+ const [logoError, setLogoError] = useState(false);
const pathname = usePathname()
const context = useContext(UserContext);
@@ -87,6 +88,11 @@ export function Header(props: Props) {
}
}, [props.config?.church?.id, props.overlayContent]);
+ // Reset logo error state when logo URL changes
+ useEffect(() => {
+ setLogoError(false);
+ }, [props.config?.appearance?.logoLight, props.config?.appearance?.logoDark, transparent]);
+
// const pathName = usePathname();
// const returnUrl = (pathName === "/") ? "" : `?returnUrl=${encodeURIComponent(pathName)}`;
@@ -238,12 +244,19 @@ export function Header(props: Props) {
//: "transparent";
}
+ const logo = getLogo();
+ const showLogoImage = logo && !logoError;
+
return (
-
+
+ {showLogoImage
+ ? ( setLogoError(true)} />)
+ : ()}
+
{getLinks()}
{userAction}
diff --git a/src/components/layouts/Footer.tsx b/src/components/layouts/Footer.tsx
index 8d84205c..67e6e961 100644
--- a/src/components/layouts/Footer.tsx
+++ b/src/components/layouts/Footer.tsx
@@ -19,7 +19,7 @@ export function Footer(props: Props) {
}
else {
let logoUrl = AppearanceHelper.getLogoDark(props.config?.appearance, "/images/logo.png");
- const photo =
+ const photo =
return (
<>