fix(overlay): re-add score stats toggle
All checks were successful
deploy / deploy (push) Successful in 59s

This commit is contained in:
Lee 2023-11-05 21:12:08 +00:00
parent a49fa9dbb6
commit c9a6703d94
2 changed files with 19 additions and 0 deletions

@ -107,6 +107,14 @@ export default function Analytics() {
settingsStore.setShowSongInfo(value); settingsStore.setShowSongInfo(value);
}} }}
/> />
<SwitchInput
id="show-score-stats"
label="Show Song Info"
defaultChecked={settingsStore.settings.showScoreStats}
onChange={(value) => {
settingsStore.setShowScoreStats(value);
}}
/>
</div> </div>
<Button <Button

@ -11,6 +11,7 @@ interface OverlaySettingsStore {
settings: { settings: {
showPlayerStats: boolean; showPlayerStats: boolean;
showSongInfo: boolean; showSongInfo: boolean;
showScoreStats: boolean;
}; };
setIpAddress: (ipAddress: string) => void; setIpAddress: (ipAddress: string) => void;
@ -18,6 +19,7 @@ interface OverlaySettingsStore {
setPlatform: (platform: string) => void; setPlatform: (platform: string) => void;
setShowPlayerStats: (showPlayerStats: boolean) => void; setShowPlayerStats: (showPlayerStats: boolean) => void;
setShowSongInfo: (showSongInfo: boolean) => void; setShowSongInfo: (showSongInfo: boolean) => void;
setShowScoreStats: (showScoreStats: boolean) => void;
} }
export const useOverlaySettingsStore = create<OverlaySettingsStore>()( export const useOverlaySettingsStore = create<OverlaySettingsStore>()(
@ -29,6 +31,7 @@ export const useOverlaySettingsStore = create<OverlaySettingsStore>()(
settings: { settings: {
showPlayerStats: true, showPlayerStats: true,
showSongInfo: true, showSongInfo: true,
showScoreStats: true,
}, },
setIpAddress(ipAddress: string) { setIpAddress(ipAddress: string) {
@ -62,6 +65,14 @@ export const useOverlaySettingsStore = create<OverlaySettingsStore>()(
}, },
}); });
}, },
setShowScoreStats(showScoreStats: boolean) {
set({
settings: {
...get().settings,
showScoreStats,
},
});
},
}), }),
{ {
name: "overlaySettings", name: "overlaySettings",