Skip to content

Commit

Permalink
[refactor] refactored DefaultConfig on client side to resemble typing…
Browse files Browse the repository at this point in the history
… in StaticConfig
  • Loading branch information
silentrald committed Oct 5, 2024
1 parent fc212ce commit 50322b6
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/renderer/config/default-configuration.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
import { BsvSearchOrder } from "shared/models/maps/beat-saver.model";

export const defaultConfiguration: { [key in DefaultConfigKey]: any } = {
// NOTE: To refactor. Rename to LocalStorageConfigKeyValues since these are stored in the
// localStorage in the browser, and for readability
export interface DefaultConfigKeyValues {
"first-color": string;
"second-color": string;
theme: ThemeConfig;
language: string;
supported_languages: string[];
default_mods: string[];
"default-shared-folders": string[];
"playlist-sort-order": BsvSearchOrder;
"map-sort-order": BsvSearchOrder;
};

export type DefaultConfigKey = keyof DefaultConfigKeyValues;

export const defaultConfiguration: {
[key in DefaultConfigKey]: DefaultConfigKeyValues[key]
} = {
"first-color": "#3b82ff",
"second-color": "#ff4444",
theme: "os",
Expand All @@ -16,6 +34,4 @@ export const defaultConfiguration: { [key in DefaultConfigKey]: any } = {
"map-sort-order": BsvSearchOrder.Latest,
};

export type DefaultConfigKey = "first-color" | "second-color" | "theme" | "language" | "supported_languages" | "default_mods" | "default-shared-folders" | "playlist-sort-order" | "map-sort-order";

export type ThemeConfig = "dark" | "light" | "os";

0 comments on commit 50322b6

Please sign in to comment.