branding only works when licensed

This commit is contained in:
miloschwartz
2025-10-15 22:07:33 -07:00
parent 003f0cfa6d
commit 2e0ad8d262
13 changed files with 145 additions and 129 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
import { useTheme } from "next-themes";
import Image from "next/image";
import { useEffect, useState } from "react";
@@ -13,6 +14,7 @@ type BrandingLogoProps = {
export default function BrandingLogo(props: BrandingLogoProps) {
const { env } = useEnvContext();
const { theme } = useTheme();
const { isUnlocked } = useLicenseStatusContext();
const [path, setPath] = useState<string>(""); // Default logo path
useEffect(() => {
@@ -27,12 +29,16 @@ export default function BrandingLogo(props: BrandingLogoProps) {
}
if (lightOrDark === "light") {
return (
env.branding.logo?.lightPath || "/logo/word_mark_black.png"
);
if (isUnlocked() && env.branding.logo?.lightPath) {
return env.branding.logo.lightPath;
}
return "/logo/word_mark_black.png";
}
return env.branding.logo?.darkPath || "/logo/word_mark_white.png";
if (isUnlocked() && env.branding.logo?.darkPath) {
return env.branding.logo.darkPath;
}
return "/logo/word_mark_white.png";
}
const path = getPath();