1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-18 21:35:27 -04:00

Theme specific metadata source images

This commit is contained in:
Mark McDowall
2026-03-08 17:43:14 -07:00
parent cd1aeefc4f
commit 15c6fa8f0e
5 changed files with 14 additions and 3 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

+10 -2
View File
@@ -2,10 +2,18 @@ import { useEffect, useState } from 'react';
import { useUiSettingsValues } from 'Settings/UI/useUiSettings';
import themes from 'Styles/Themes';
const useTheme = () => {
const useTheme = (): 'dark' | 'light' => {
const { theme } = useUiSettingsValues();
const selectedTheme = theme ?? window.Sonarr.theme;
const [resolvedTheme, setResolvedTheme] = useState(selectedTheme);
const [resolvedTheme, setResolvedTheme] = useState(() => {
if (selectedTheme === 'auto') {
return window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light';
}
return selectedTheme;
});
useEffect(() => {
if (selectedTheme !== 'auto') {
@@ -1,14 +1,17 @@
import React from 'react';
import InlineMarkdown from 'Components/Markdown/InlineMarkdown';
import useTheme from 'Helpers/Hooks/useTheme';
import translate from 'Utilities/String/translate';
import styles from './TheTvdb.css';
function TheTvdb() {
const theme = useTheme();
return (
<div className={styles.container}>
<img
className={styles.image}
src={`${window.Sonarr.urlBase}/Content/Images/thetvdb.png`}
src={`${window.Sonarr.urlBase}/Content/Images/thetvdb-${theme}.png`}
/>
<div className={styles.info}>