mirror of
https://github.com/modrinth/code.git
synced 2026-08-28 02:24:56 +00:00
feat: preferences syncing frontend (#7192)
* feat: prefs frontend * fix: DI issue * fix: lint * feat: appearance settings cleanup + fix settings, remove pinia * fix: sync btn when logged out * fix: prepr * fix: sidebar issue * feat: language coverage + cleanup * feat: cleanup lang settings * fix: fmt * fix: CI * fix: ci * fix: storybook * feat: bring back loader/game version sort --------- Co-authored-by: tdgao <mr.trumgao@gmail.com>
This commit is contained in:
@@ -7,6 +7,8 @@ pub struct UserPreferences {
|
||||
#[component(nested)]
|
||||
pub appearance: AppearancePreferences,
|
||||
#[component(nested)]
|
||||
pub behavior: BehaviorPreferences,
|
||||
#[component(nested)]
|
||||
pub localization: LocalizationPreferences,
|
||||
#[component(nested)]
|
||||
pub layouts: LayoutPreferences,
|
||||
@@ -34,6 +36,31 @@ pub struct AppearancePreferences {
|
||||
pub theme: Theme,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema, PartialEq, Component)]
|
||||
pub struct BehaviorPreferences {
|
||||
pub minimize_app: bool,
|
||||
pub hide_right_sidebar: bool,
|
||||
pub show_jump_in: bool,
|
||||
pub show_play_time: bool,
|
||||
pub hide_nametag: bool,
|
||||
pub warn_on_unknown_modpacks: bool,
|
||||
pub skip_non_essential_warnings: bool,
|
||||
}
|
||||
|
||||
impl Default for BehaviorPreferences {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
minimize_app: false,
|
||||
hide_right_sidebar: false,
|
||||
show_jump_in: true,
|
||||
show_play_time: true,
|
||||
hide_nametag: false,
|
||||
warn_on_unknown_modpacks: true,
|
||||
skip_non_essential_warnings: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Debug, Serialize, Deserialize, ToSchema, Default, Clone, PartialEq,
|
||||
)]
|
||||
|
||||
Reference in New Issue
Block a user