Code Review

This commit is contained in:
2025-09-09 19:20:30 +10:00
parent 11d08b6403
commit d53fd08ee8
2 changed files with 27 additions and 22 deletions
+16 -11
View File
@@ -54,18 +54,23 @@ export const Settings = () => {
settings.trackTitleGlow,
);
// Use a permissive wrapper to align with current usage props
// Derive props and override onChange to accept a broader first param type
type BaseSwitchProps = React.ComponentProps<typeof LunaSwitchSetting>;
type AnySwitchProps = Omit<BaseSwitchProps, "onChange"> & {
onChange: (_: unknown, checked: boolean) => void;
checked: boolean;
};
const AnySwitch = LunaSwitchSetting as unknown as React.ComponentType<
Record<string, unknown>
AnySwitchProps
>;
return (
<LunaSettings>
<AnySwitch
title="Lyrics Glow Effect"
desc="Enable glowing effect for lyrics & Font Stytling Changes"
desc="Enable glowing effect for lyrics & Font Styling Changes"
checked={lyricsGlowEnabled}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
setLyricsGlowEnabled((settings.lyricsGlowEnabled = checked));
// Update styles immediately when setting changes
if ((window as any).updateRadiantLyricsStyles) {
@@ -77,7 +82,7 @@ export const Settings = () => {
title="Track Title Glow"
desc="Apply glow to the track title"
checked={trackTitleGlow}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
setTrackTitleGlow((settings.trackTitleGlow = checked));
if ((window as any).updateRadiantLyricsStyles) {
(window as any).updateRadiantLyricsStyles();
@@ -88,7 +93,7 @@ export const Settings = () => {
title="Hide UI Feature"
desc="Enable hide/unhide UI functionality with toggle buttons"
checked={hideUIEnabled}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
setHideUIEnabled((settings.hideUIEnabled = checked));
}}
/>
@@ -96,7 +101,7 @@ export const Settings = () => {
title="Player Bar Visibility in Hide UI Mode"
desc="Keep player bar visible when UI is hidden"
checked={playerBarVisible}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
console.log("Player Bar Visibility:", checked ? "visible" : "hidden");
setPlayerBarVisible((settings.playerBarVisible = checked));
// Update styles immediately when setting changes
@@ -109,7 +114,7 @@ export const Settings = () => {
title="Cover Everywhere"
desc="Apply the spinning Cover Art background to the entire app, not just the Now Playing view, Heavily Inspired by Cover-Theme by @Inrixia"
checked={spinningCoverEverywhere}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
console.log(
"Spinning Cover Everywhere:",
checked ? "enabled" : "disabled",
@@ -127,7 +132,7 @@ export const Settings = () => {
title="Performance Mode | Experimental"
desc="Performance mode: Reduces blur effects & uses smaller image sizes, to optimize GPU usage"
checked={performanceMode}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
console.log("Performance Mode:", checked ? "enabled" : "disabled");
setPerformanceMode((settings.performanceMode = checked));
// Update background animations immediately when setting changes
@@ -143,7 +148,7 @@ export const Settings = () => {
title="Background Cover Spin" // Cheers @Max/n0201 for the idea <3
desc="Enable the spinning cover art background animation"
checked={spinningArtEnabled}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
console.log(
"Background Cover Spin:",
checked ? "enabled" : "disabled",
@@ -262,7 +267,7 @@ export const Settings = () => {
title="Settings Affect Now Playing"
desc="Apply background settings to Now Playing view"
checked={settingsAffectNowPlaying}
onChange={(_: void, checked: boolean) => {
onChange={(_: unknown, checked: boolean) => {
console.log(
"Settings Affect Now Playing:",
checked ? "enabled" : "disabled",