TorbatYar/frontend/hooks/useTheme.ts
Mortezakoohjani 800b0ba2c5 Deploy TorbatYar for torbatyar.ir with nginx multi-tenant routing.
Wire production domain, CORS for tenant subdomains, celery volume mounts, and nginx reverse proxy configs for apex, API, identity, auth, and wildcard tenants.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:43:33 +03:30

21 lines
535 B
TypeScript

"use client";
import { useEffect, useState } from "react";
import { applyTheme, loadTheme, type ThemeConfig } from "@/lib/theme";
/** بارگذاری و اعمال تم White-label در زمان mount. */
export function useTheme() {
const [theme, setTheme] = useState<ThemeConfig | null>(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
loadTheme().then((t) => {
applyTheme(t);
setTheme(t);
setLoading(false);
});
}, []);
return { theme, loading };
}