Files
crosscode-platform/apps/accounts/frontend/src/components/BrandingProvider.tsx
T

16 lines
757 B
TypeScript

"use client";
import React, { createContext, useContext } from "react";
import type { FooterChurch } from "@crosscode/ui";
/** `church` (1.7.0): the profile for the shared footer, null when it couldn't be loaded. */
export type ClientBranding = { name: string; shortName: string | null; logoUrl: string | null; signupEnabled: boolean; setupNeeded: boolean; church?: FooterChurch | null };
const Ctx = createContext<ClientBranding>({ name: "Sign in", shortName: null, logoUrl: null, signupEnabled: true, setupNeeded: false });
export function BrandingProvider({ value, children }: { value: ClientBranding; children: React.ReactNode }) {
return <Ctx.Provider value={value}>{children}</Ctx.Provider>;
}
export const useBranding = () => useContext(Ctx);