mirror of https://github.com/usememos/memos.git
This commit is contained in:
parent
7c3fcc297d
commit
013ea52519
|
|
@ -2,7 +2,7 @@ import { GlobeIcon } from "lucide-react";
|
|||
import { FC } from "react";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { locales } from "@/i18n";
|
||||
import { getLocaleDisplayName } from "@/utils/i18n";
|
||||
import { getLocaleDisplayName, loadLocale } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
value: Locale;
|
||||
|
|
@ -13,6 +13,9 @@ const LocaleSelect: FC<Props> = (props: Props) => {
|
|||
const { onChange, value } = props;
|
||||
|
||||
const handleSelectChange = async (locale: Locale) => {
|
||||
// Apply locale globally immediately
|
||||
loadLocale(locale);
|
||||
// Also notify parent component
|
||||
onChange(locale);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Monitor, Moon, MoonStar, Palette, Sun, Wallpaper } from "lucide-react";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { THEME_OPTIONS } from "@/utils/theme";
|
||||
import { loadTheme, THEME_OPTIONS } from "@/utils/theme";
|
||||
|
||||
interface ThemeSelectProps {
|
||||
value?: string;
|
||||
|
|
@ -21,6 +21,9 @@ const ThemeSelect = ({ value, onValueChange, className }: ThemeSelectProps = {})
|
|||
const currentTheme = value || "system";
|
||||
|
||||
const handleThemeChange = (newTheme: string) => {
|
||||
// Apply theme globally immediately
|
||||
loadTheme(newTheme);
|
||||
// Also notify parent component if callback is provided
|
||||
if (onValueChange) {
|
||||
onValueChange(newTheme);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue