Add files via upload

This commit is contained in:
Egor
2026-01-15 19:18:17 +03:00
committed by GitHub
parent b118008cdc
commit 7be6b5c0ae
70 changed files with 21835 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { useEffect } from 'react'
import { useQuery } from '@tanstack/react-query'
import { themeColorsApi } from '../api/themeColors'
import { DEFAULT_THEME_COLORS } from '../types/theme'
import { applyThemeColors } from '../hooks/useThemeColors'
interface ThemeColorsProviderProps {
children: React.ReactNode
}
export function ThemeColorsProvider({ children }: ThemeColorsProviderProps) {
const { data: colors } = useQuery({
queryKey: ['theme-colors'],
queryFn: themeColorsApi.getColors,
staleTime: 5 * 60 * 1000, // 5 minutes
refetchOnWindowFocus: false,
retry: 1,
})
// Apply colors on mount and when they change
useEffect(() => {
applyThemeColors(colors || DEFAULT_THEME_COLORS)
}, [colors])
return <>{children}</>
}