mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +03:00
Run Prettier
This commit is contained in:
parent
90c61eeff6
commit
3ca2231e10
@ -23,7 +23,7 @@ export const colorSchemes: ColorScheme[] = [
|
|||||||
// eslint-disable-next-line react-refresh/only-export-components
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export const friendlyColorSchemeName = (
|
export const friendlyColorSchemeName = (
|
||||||
className: string,
|
className: string,
|
||||||
t?: (key: string, options?: any) => string
|
t?: (key: string, options?: any) => string,
|
||||||
): string => {
|
): string => {
|
||||||
const words = className.split("-").slice(1);
|
const words = className.split("-").slice(1);
|
||||||
const key = "menu.theme." + words.join("");
|
const key = "menu.theme." + words.join("");
|
||||||
@ -39,7 +39,6 @@ export const friendlyColorSchemeName = (
|
|||||||
return t(key, { defaultValue: fallback });
|
return t(key, { defaultValue: fallback });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
type ThemeProviderProps = {
|
type ThemeProviderProps = {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
defaultTheme?: Theme;
|
defaultTheme?: Theme;
|
||||||
@ -134,9 +133,7 @@ export function ThemeProvider({
|
|||||||
colorSchemes.push(className);
|
colorSchemes.push(className);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!document.querySelector(`link[data-theme="${className}"]`)) {
|
||||||
!document.querySelector(`link[data-theme="${className}"]`)
|
|
||||||
) {
|
|
||||||
const link = document.createElement("link");
|
const link = document.createElement("link");
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.href = `/config/themes/${file}`;
|
link.href = `/config/themes/${file}`;
|
||||||
@ -150,7 +147,6 @@ export function ThemeProvider({
|
|||||||
}
|
}
|
||||||
|
|
||||||
root.classList.remove("light", "dark", "system", ...colorSchemes);
|
root.classList.remove("light", "dark", "system", ...colorSchemes);
|
||||||
|
|
||||||
root.classList.add(theme, colorScheme);
|
root.classList.add(theme, colorScheme);
|
||||||
|
|
||||||
if (systemTheme) {
|
if (systemTheme) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user