diff --git a/src/components/settings/AnimatedThemeBadge.tsx b/src/components/settings/AnimatedThemeBadge.tsx new file mode 100644 index 00000000..fcebb8a2 --- /dev/null +++ b/src/components/settings/AnimatedThemeBadge.tsx @@ -0,0 +1,44 @@ +import { Activity } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; + +type Variant = 'inline' | 'overlay'; + +/** + * Small amber "animated theme" chip, shown only on animation-risk setups + * (Nvidia/Linux or compositing off). A motion glyph rather than a hazard + * triangle — the CPU-usage caveat lives in the tooltip. + * + * - `inline` — sits after a theme name (Theme Store rows). + * - `overlay` — pinned top-centre on an installed theme's preview swatch + * (top-right is the active indicator, top-left the uninstall X). + */ +export function AnimatedThemeBadge({ variant }: { variant: Variant }) { + const { t } = useTranslation(); + const overlay = variant === 'overlay'; + return ( + + + + ); +} diff --git a/src/components/settings/InstalledThemes.tsx b/src/components/settings/InstalledThemes.tsx index a068bd0d..fb292772 100644 --- a/src/components/settings/InstalledThemes.tsx +++ b/src/components/settings/InstalledThemes.tsx @@ -1,9 +1,10 @@ -import { AlertTriangle, Check, X } from 'lucide-react'; +import { Check, X } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { useThemeStore } from '../../store/themeStore'; import { useInstalledThemesStore } from '../../store/installedThemesStore'; import { uninstallTheme } from '../../utils/themes/uninstallTheme'; import { useThemeAnimationRisk } from '../../hooks/useThemeAnimationRisk'; +import { AnimatedThemeBadge } from './AnimatedThemeBadge'; import { FIXED_THEMES } from './fixedThemes'; /** Pull a 3-band swatch (bg / card / accent) out of an installed theme's CSS. */ @@ -80,30 +81,7 @@ export function InstalledThemes() { )} - {animRisk && c.animated && ( - - - - )} + {animRisk && c.animated && } {c.label} diff --git a/src/components/settings/ThemeStoreSection.tsx b/src/components/settings/ThemeStoreSection.tsx index 450c6d01..550b0b67 100644 --- a/src/components/settings/ThemeStoreSection.tsx +++ b/src/components/settings/ThemeStoreSection.tsx @@ -1,9 +1,10 @@ import { useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { AlertTriangle, Check, ChevronLeft, ChevronRight, Download, RefreshCw, Trash2, WifiOff } from 'lucide-react'; +import { Check, ChevronLeft, ChevronRight, Download, RefreshCw, Trash2, WifiOff } from 'lucide-react'; import { open as openUrl } from '@tauri-apps/plugin-shell'; import CoverLightbox from '../CoverLightbox'; import { useThemeAnimationRisk } from '../../hooks/useThemeAnimationRisk'; +import { AnimatedThemeBadge } from './AnimatedThemeBadge'; import { useThemeStore } from '../../store/themeStore'; import { useInstalledThemesStore, type InstalledTheme } from '../../store/installedThemesStore'; import { @@ -295,17 +296,7 @@ export function ThemeStoreSection() { {t('settings.themeStoreActive')} )} - {animRisk && th.animated && ( - - - - )} + {animRisk && th.animated && }
{t('settings.themeStoreByAuthor', { author: th.author })}