1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/hooks/useThemes.ts
thornbill 1929ba8eb2 Backport pull request #5589 from jellyfin-web/release-10.9.z
Add support for user themes for mui components

Original-merge: 61976b8101

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-05-26 18:49:25 -04:00

16 lines
340 B
TypeScript

import { useMemo } from 'react';
import { useWebConfig } from './useWebConfig';
export function useThemes() {
const { themes } = useWebConfig();
const defaultTheme = useMemo(() => {
return themes?.find(theme => theme.default);
}, [ themes ]);
return {
themes: themes || [],
defaultTheme
};
}