mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add support for user themes for mui components
This commit is contained in:
parent
3dcb42daac
commit
b5fda71a27
16 changed files with 298 additions and 62 deletions
16
src/hooks/useThemes.ts
Normal file
16
src/hooks/useThemes.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue