Files
openchamber/packages/ui/src/components/providers/ThemeProvider.tsx
T

21 lines
636 B
TypeScript
Raw Normal View History

2025-12-07 19:32:53 +02:00
import React from 'react';
import { useUIStore } from '@/stores/useUIStore';
interface ThemeProviderProps {
children: React.ReactNode;
}
export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
const fontSize = useUIStore((state) => state.fontSize);
const applyTypography = useUIStore((state) => state.applyTypography);
const padding = useUIStore((state) => state.padding);
const applyPadding = useUIStore((state) => state.applyPadding);
2025-12-07 19:32:53 +02:00
React.useLayoutEffect(() => {
applyTypography();
applyPadding();
}, [fontSize, applyTypography, padding, applyPadding]);
2025-12-07 19:32:53 +02:00
return <>{children}</>;
};