Add WhyRating Templates - brand identity system

Next.js app showcasing WhyRating brand guidelines with interactive
tabs for colors, typography, proportions, logos, voice, downloads,
and AI context. Includes email templates (headers, signatures, CTAs)
and presentation component.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-18 15:17:42 +01:00
parent 9a0881e852
commit ea5775da25
68 changed files with 15159 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
'use client';
import { createContext, useContext, useState, useEffect, ReactNode } from 'react';
import { BrandConfig, getBrandConfig, saveBrandConfig, resetBrandConfig, defaultBrandConfig } from './brand-config';
interface BrandContextType {
config: BrandConfig;
updateConfig: (updates: Partial<BrandConfig>) => void;
resetConfig: () => void;
isLoaded: boolean;
}
const BrandContext = createContext<BrandContextType | undefined>(undefined);
export function BrandProvider({ children }: { children: ReactNode }) {
const [config, setConfig] = useState<BrandConfig>(defaultBrandConfig);
const [isLoaded, setIsLoaded] = useState(false);
useEffect(() => {
setConfig(getBrandConfig());
setIsLoaded(true);
}, []);
const updateConfig = (updates: Partial<BrandConfig>) => {
const newConfig = saveBrandConfig(updates);
setConfig(newConfig);
};
const resetConfigHandler = () => {
const newConfig = resetBrandConfig();
setConfig(newConfig);
};
return (
<BrandContext.Provider value={{ config, updateConfig, resetConfig: resetConfigHandler, isLoaded }}>
{children}
</BrandContext.Provider>
);
}
export function useBrand() {
const context = useContext(BrandContext);
if (context === undefined) {
throw new Error('useBrand must be used within a BrandProvider');
}
return context;
}