feat: complete user config management
- Add theme support with dark/light/system modes - Add useTheme hook for applying user config theme - Update router to use SettingsPage - Update app-shell to apply theme on load - Add CSS variables for dark theme - Fix mypy errors in user_config.py - Quality gates pass: ruff, mypy, typecheck, lint, build
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { apiClient } from "./client";
|
||||
|
||||
export interface UserConfig {
|
||||
default_editor: string | null;
|
||||
theme: string;
|
||||
git_user_name: string | null;
|
||||
git_user_email: string | null;
|
||||
}
|
||||
|
||||
export interface UserConfigUpdate {
|
||||
default_editor?: string;
|
||||
theme?: string;
|
||||
git_user_name?: string;
|
||||
git_user_email?: string;
|
||||
}
|
||||
|
||||
export const getUserConfig = async (): Promise<UserConfig> => {
|
||||
const response = await apiClient.get<UserConfig>("/users/me/config");
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const updateUserConfig = async (data: UserConfigUpdate): Promise<UserConfig> => {
|
||||
const response = await apiClient.patch<UserConfig>("/users/me/config", data);
|
||||
return response.data;
|
||||
};
|
||||
Reference in New Issue
Block a user